Keep Porcelainish from failing by broken ident after making changes.
[gitweb.git] / git-rebase.sh
index a2651be1fe0bcbb8b615c2def86561ed91547093..21c3d83c3ade9bfb0cdabb00928eab4606062c1a 100755 (executable)
@@ -73,6 +73,15 @@ upstream_name="$1"
 upstream=`git rev-parse --verify "${upstream_name}^0"` ||
     die "invalid upsteram $upstream_name"
 
+# If a hook exists, give it a chance to interrupt
+if test -x "$GIT_DIR/hooks/pre-rebase"
+then
+       "$GIT_DIR/hooks/pre-rebase" ${1+"$@"} || {
+               echo >&2 "The pre-rebase hook refused to rebase."
+               exit 1
+       }
+fi
+
 # If the branch to rebase is given, first switch to it.
 case "$#" in
 2)