X-Git-Url: https://git.ao2.it/config/vcsh.git/blobdiff_plain/9b5157bf589b2c1921c7cca8e59f965c169a86a6..5afec708492bbba786c5b8ddd7715118cddcedba:/.config/vcsh/hooks-available/update-working-tree.sh diff --git a/.config/vcsh/hooks-available/update-working-tree.sh b/.config/vcsh/hooks-available/update-working-tree.sh new file mode 100755 index 0000000..8d88e8c --- /dev/null +++ b/.config/vcsh/hooks-available/update-working-tree.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Verify if the current branch is valid before updating the working tree. +# This avoids errors with empty repositories which would only confuse the +# user. +if git rev-parse --verify HEAD >/dev/null 2>&1; +then + git read-tree -mu HEAD +fi +