hooks-available: avoid some errors with empty repositories
authorAntonio Ospite <ao2@ao2.it>
Thu, 13 Dec 2018 23:15:05 +0000 (00:15 +0100)
committerAntonio Ospite <ao2@ao2.it>
Mon, 17 Dec 2018 09:37:45 +0000 (10:37 +0100)
commit8bdae58f5b9906d57e5d4384e5fda1b93cef6aac
tree46963e9c230433d8ed2df813fe87bf5f21ca8ae8
parent3535ec27f70d73034e315faf7e3ded8c75c0413d
hooks-available: avoid some errors with empty repositories

When entering a repository which has just been created the HEAD
reference does not exist yet  and "git read-tree -mu HEAD" would
complain loudly about that, giving a confusing error to users.

Avoid the error by checking the validity of HEAD before updating the
working tree.
.config/vcsh/hooks-available/populate-fully.sh
.config/vcsh/hooks-available/populate-sparsely.sh