5 # Only the same instance of vcsh that had the working tree fully populated is
6 # allowed to repopulate it sparsely.
9 # If LOCKDIR does not exist it means that the lock is not active so there's no
10 # need to do anything.
11 [ -d "$LOCKDIR" ] || exit 0
13 LOCKPID=$(cat "$LOCKDIR/pid")
14 # Use the parent pid because the hooks are launched as children of vcsh.
15 [ "$LOCKPID" = $PPID ] || { echo "Repository entered from another vcsh instance. Aborting." 1>&2; exit 1; }
17 : "${XDG_CONFIG_HOME:="$HOME/.config"}"
19 # shellcheck source=/dev/null
20 . "$XDG_CONFIG_HOME/vcsh/hooks-available/enable-sparse-checkout.sh"
22 # shellcheck source=/dev/null
23 . "$XDG_CONFIG_HOME/vcsh/hooks-available/update-working-tree.sh"
25 # Unlock the working tree.