@matheusbsbs / matheus-bagliano / commits / 7a3db75bee
Fork 0

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>

Junio C Hamano committed Nov 22, 2007 at 23:25 UTC 7a3db75beee75c4e1b5fdae7504bc2ba05c58b14
1 file changed +1 -1
templates/hooks--pre-commit
+1 -1
@@ -13,7 +13,7 @@
13
14 if git-rev-parse --verify HEAD 2>/dev/null
15 then
16 - git-diff-index -p -M --cached HEAD
16 + git-diff-index -p -M --cached HEAD --
17 else
18 # NEEDSWORK: we should produce a diff with an empty tree here
19 # if we want to do the same verification for the initial import.