mirror of
https://github.com/git/git
synced 2024-09-12 21:04:12 +00:00
Fix sample pre-commit hook
If the worktree happened to have a file called HEAD, "diff-index --cached HEAD" would complain about the ambiguity between revision and path. Avoid it by using an explicit "--" for disambiguation. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
958e67c0a8
commit
7a3db75bee
|
@ -13,7 +13,7 @@
|
|||
|
||||
if git-rev-parse --verify HEAD 2>/dev/null
|
||||
then
|
||||
git-diff-index -p -M --cached HEAD
|
||||
git-diff-index -p -M --cached HEAD --
|
||||
else
|
||||
# NEEDSWORK: we should produce a diff with an empty tree here
|
||||
# if we want to do the same verification for the initial import.
|
||||
|
|
Loading…
Reference in a new issue