hooks: factor out an update-working-tree.sh script
[config/vcsh.git] / .config / vcsh / hooks-available / update-working-tree.sh
1 #!/bin/sh
2
3 # Verify if the current branch is valid before updating the working tree.
4 # This avoids errors with empty repositories which would only confuse the
5 # user.
6 if git rev-parse --verify HEAD >/dev/null 2>&1;
7 then
8   git read-tree -mu HEAD
9 fi
10