X-Git-Url: https://git.ao2.it/config/vcsh.git/blobdiff_plain/2ec706e30dfff503a575df0c8d5d5986d263c4bd..9b5157bf589b2c1921c7cca8e59f965c169a86a6:/.config/vcsh/hooks-available/enable-sparse-checkout.sh diff --git a/.config/vcsh/hooks-available/enable-sparse-checkout.sh b/.config/vcsh/hooks-available/enable-sparse-checkout.sh new file mode 100755 index 0000000..2ebf5a5 --- /dev/null +++ b/.config/vcsh/hooks-available/enable-sparse-checkout.sh @@ -0,0 +1,12 @@ +#!/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 +rm -f "$GIT_DIR/info/sparse-checkout" +ln -s "$XDG_CONFIG_HOME/vcsh/sparse-checkout" "$GIT_DIR/info/sparse-checkout"