pre-commit.sample: don't print incidental SHA1
authorJim Meyering <jim@meyering.net>
Sat, 16 May 2009 10:21:50 +0000 (12:21 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 16 May 2009 18:57:17 +0000 (11:57 -0700)
Make the sample pre-commit hook script discard
all git-rev-parse output, not just stderr.
Otherwise, it would print an SHA1.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
templates/hooks--pre-commit.sample

index 0e49279c7f7b805c78f1bc4760a0d1c70a84a0d9..0ba62076fb4a381e588eba90ed639dd560860fd3 100755 (executable)
@@ -7,7 +7,7 @@
 #
 # To enable this hook, rename this file to "pre-commit".
 
-if git-rev-parse --verify HEAD 2>/dev/null
+if git-rev-parse --verify HEAD >/dev/null 2>&1
 then
        against=HEAD
 else