Merge branch 'master' of git://repo.or.cz/git-gui
[gitweb.git] / templates / hooks--update
index 0dcb1adb132d5d127bc6c693bac1528cb567e517..9d3795c6d055d3ca2b50ac0607607037cb2b8142 100644 (file)
@@ -41,7 +41,12 @@ if [ -z "$projectdesc" -o "$projectdesc" = "Unnamed repository; edit this file t
 fi
 
 # --- Check types
-newrev_type=$(git-cat-file -t $newrev)
+# if $newrev is 0000...0000, it's a commit to delete a branch
+if [ -z "${newrev##0*}" ]; then
+       newrev_type=commit
+else
+       newrev_type=$(git-cat-file -t $newrev)
+fi
 
 case "$refname","$newrev_type" in
        refs/tags/*,commit)