Skip to content
Browse files

Made it better, but I forget why

Just never got around to committing this :-/
  • Loading branch information...
1 parent 8fce90e commit a9b6a680f038c95f341d8daa82c71a56f5949fe2 @appden committed
Showing with 4 additions and 3 deletions.
  1. +4 −3 hooks/update
View
7 hooks/update
@@ -16,10 +16,11 @@ if [ -z "$GIT_DIR" -o -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
exit 1
fi
-# if the new revision is all 0's then it's a commit to delete a ref
zero="0000000000000000000000000000000000000000"
-# also check if the new revision is not a commit or is not a fast forward
-if [ "$newrev" = "$zero" ] || [ $(git cat-file -t $newrev) != "commit" ] || [ $(git merge-base $oldrev $newrev) != "$oldrev" ]; then
+if [ "$oldrev" = "$zero" ] || # new branch
+ [ "$newrev" = "$zero" ] || # delete branch
+ [ $(git cat-file -t $newrev) != "commit" ] || # not a commit
+ [ $(git merge-base $oldrev $newrev) != "$oldrev" ]; then # not a fast forward
exit 0
fi

0 comments on commit a9b6a68

Please sign in to comment.
Something went wrong with that request. Please try again.