Code

scripts: do not get confused with HEAD in work tree
[git.git] / templates / hooks--pre-commit
index 723a9ef210bb84c217026c2cdf9d30661f64447b..8b057be30411e3f0074599778666c1254d82329e 100644 (file)
@@ -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.
@@ -68,4 +68,3 @@ perl -e '
     }
     exit($found_bad);
 '
-