From d0ef17b3aae0b08bdc68a339f9a916493aaf6e00 Mon Sep 17 00:00:00 2001 From: Geoffrey Thomas Date: Fri, 8 May 2009 00:17:32 -0400 Subject: [PATCH] Don't crash when a branch is created. It doesn't give you particularly useful output, and it doesn't handle the case of a branch being deleted. But it's a little better. Signed-off-by: Geoffrey Thomas --- git-hooks/zephyr-post-receive | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/git-hooks/zephyr-post-receive b/git-hooks/zephyr-post-receive index 7e06b30..e7b70d9 100755 --- a/git-hooks/zephyr-post-receive +++ b/git-hooks/zephyr-post-receive @@ -25,6 +25,12 @@ if [ -z "$class" ]; then exit 1 fi while read oldrev newrev refname; do + if [ "$oldrev" = "0000000000000000000000000000000000000000" ]; then + # dammit git + zwrite -c "$class" -i "$(basename "$refname")" -s "${zsig:-Git}: $refname" -d \ + -m "New branch created." + continue + fi git-rev-list --reverse "$oldrev..$newrev" | while read rev; do shortrev=`git log -1 --pretty=format:%h "$rev"` (git show --stat $usecolor "$rev" | -- 2.45.0