]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-rebase.sh
Documentation: bisect: make a comment fit better in the man page.
[git.git] / git-rebase.sh
index b51d19d12e6d5a108f13c4ec60c5f5a6e560ef47..aadd580f8d40b0d97834e7bf25f58ab9e65faeb1 100755 (executable)
@@ -265,6 +265,10 @@ upstream_name="$1"
 upstream=`git rev-parse --verify "${upstream_name}^0"` ||
     die "invalid upstream $upstream_name"
 
+# Make sure the branch to rebase onto is valid.
+onto_name=${newbase-"$upstream_name"}
+onto=$(git-rev-parse --verify "${onto_name}^0") || exit
+
 # If a hook exists, give it a chance to interrupt
 if test -x "$GIT_DIR/hooks/pre-rebase"
 then
@@ -291,10 +295,6 @@ case "$#" in
 esac
 branch=$(git-rev-parse --verify "${branch_name}^0") || exit
 
-# Make sure the branch to rebase onto is valid.
-onto_name=${newbase-"$upstream_name"}
-onto=$(git-rev-parse --verify "${onto_name}^0") || exit
-
 # Now we are rebasing commits $upstream..$branch on top of $onto
 
 # Check if we are already based on $onto, but this should be