summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5946d88)
raw | patch | inline | side by side (parent: 5946d88)
author | Gerrit Pape <pape@smarden.org> | |
Mon, 16 Apr 2007 08:31:35 +0000 (08:31 +0000) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 16 Apr 2007 08:35:39 +0000 (01:35 -0700) |
source ref might be 0000...0000 to delete a branch through git-push,
'git <remote> push :<branch>'. The update hook should not decline this.
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
'git <remote> push :<branch>'. The update hook should not decline this.
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
templates/hooks--update | patch | blob | history |
index 0dcb1adb132d5d127bc6c693bac1528cb567e517..9d3795c6d055d3ca2b50ac0607607037cb2b8142 100644 (file)
--- a/templates/hooks--update
+++ b/templates/hooks--update
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)