X-Git-Url: https://git.ao2.it/config/vcsh.git/blobdiff_plain/e7109b26ca3742d660d77df5a94326297f00eaa0..c6461aa97fe3711c2055721aa37d8b0d19579f49:/.config/vcsh/hooks-available/populate-fully.sh diff --git a/.config/vcsh/hooks-available/populate-fully.sh b/.config/vcsh/hooks-available/populate-fully.sh index 46e155f..b038d1e 100755 --- a/.config/vcsh/hooks-available/populate-fully.sh +++ b/.config/vcsh/hooks-available/populate-fully.sh @@ -2,7 +2,10 @@ set -e -# Only one vcsh instance at a time can have the work dir fully populated. +# If the vcsh repository does not exist, exit without doing anything. +[ -d "$GIT_DIR" ] || exit 0 + +# Only one vcsh instance at a time can have the working tree fully populated. LOCKDIR=/run/lock/vcsh # Kill the parent process because vcsh does not catch the hook exit value. @@ -13,7 +16,7 @@ mkdir "$LOCKDIR" 2>/dev/null || { echo "An instance of vcsh already entered a re echo $PPID > "$LOCKDIR/pid" # git read-tree manual page says this is the proper way to fully repopulate -# the working directory +# the working tree. git config core.sparseCheckout true rm -f "$GIT_DIR/info/sparse-checkout" echo "/*" > "$GIT_DIR/info/sparse-checkout"