From 69069d2039555a14acb35d378ad14cb8430b9fb4 Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Fri, 14 Dec 2018 16:07:20 +0100 Subject: [PATCH] sparse-checkout.sh: don't do anything if the repository does not exist --- .config/vcsh/hooks-available/sparse-checkout.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/vcsh/hooks-available/sparse-checkout.sh b/.config/vcsh/hooks-available/sparse-checkout.sh index b23909d..2ebf5a5 100755 --- a/.config/vcsh/hooks-available/sparse-checkout.sh +++ b/.config/vcsh/hooks-available/sparse-checkout.sh @@ -1,5 +1,10 @@ #!/bin/sh +set -e + +# If the vcsh repository does not exist, exit without doing anything. +[ -d "$GIT_DIR" ] || exit 0 + : "${XDG_CONFIG_HOME:="$HOME/.config"}" git config core.sparseCheckout true -- 2.1.4