Code

hooks--update: Explicitly check for all zeros for a deleted ref.
authorAlexandre Julliard <julliard@winehq.org>
Wed, 12 Sep 2007 21:36:03 +0000 (23:36 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Sep 2007 05:33:11 +0000 (22:33 -0700)
The previous check caused the hook to reject as unannotated any tag
whose SHA1 starts with a zero.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
templates/hooks--update

index 9d3795c6d055d3ca2b50ac0607607037cb2b8142..d8c76264beaf198f1f3558ca8429349c8eab9ead 100644 (file)
@@ -42,7 +42,7 @@ fi
 
 # --- Check types
 # if $newrev is 0000...0000, it's a commit to delete a branch
-if [ -z "${newrev##0*}" ]; then
+if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then
        newrev_type=commit
 else
        newrev_type=$(git-cat-file -t $newrev)