summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-22 23:25:19 -0800
committerJunio C Hamano <gitster@pobox.com>2007-11-22 23:25:19 -0800
commit7a3db75beee75c4e1b5fdae7504bc2ba05c58b14 (patch)
tree774efa464bf2e1663af1512db633c7de756ca74e /templates
parent958e67c0a8b7f12462ad1828ac3b3178181ea4e9 (diff)
downloadgit-7a3db75beee75c4e1b5fdae7504bc2ba05c58b14.tar.gz
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>
Diffstat (limited to 'templates')
-rw-r--r--templates/hooks--pre-commit2
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/hooks--pre-commit b/templates/hooks--pre-commit
index 18b87309f6..8b057be304 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.