5 # Only one vcsh instance at a time can have the working tree fully populated.
8 # Kill the parent process because vcsh does not catch the hook exit value.
9 # See: https://github.com/RichiH/vcsh/issues/251
10 mkdir "$LOCKDIR" 2>/dev/null || { echo "An instance of vcsh already entered a repository." 1>&2; kill -- -$PPID;}
12 # Lock on the parent pid because the hooks are launched as children of vcsh.
13 echo $PPID > "$LOCKDIR/pid"
15 # git read-tree manual page says this is the proper way to fully repopulate
17 git config core.sparseCheckout true
18 rm -f "$GIT_DIR/info/sparse-checkout"
19 echo "/*" > "$GIT_DIR/info/sparse-checkout"
20 git read-tree -mu HEAD
21 git config core.sparseCheckout false