From: Junio C Hamano Date: Fri, 23 Nov 2007 07:25:19 +0000 (-0800) Subject: Fix sample pre-commit hook X-Git-Tag: v1.5.3.7~16 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7a3db75beee75c4e1b5fdae7504bc2ba05c58b14;p=git.git 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 --- diff --git a/templates/hooks--pre-commit b/templates/hooks--pre-commit index 18b87309f..8b057be30 100644 --- a/templates/hooks--pre-commit +++ b/templates/hooks--pre-commit @@ -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.