summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-12-14 11:11:37 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-12-14 21:04:25 (GMT)
commit2db8aaeca1dca4e940829b87d1164e5b42ff49b4 (patch)
treef164bcafc5a3b0cb450cefcc1111bb2671c91aee
parentb0d3e9baaa16c805ef941e8f26d55fb23f091ef5 (diff)
downloadgit-2db8aaeca1dca4e940829b87d1164e5b42ff49b4.zip
git-2db8aaeca1dca4e940829b87d1164e5b42ff49b4.tar.gz
git-2db8aaeca1dca4e940829b87d1164e5b42ff49b4.tar.bz2
rebase: do not get confused in fast-forward situation.
When switching to another branch and rebasing it in a one-go, it failed to update the variable that holds the branch head, and did not detect fast-forward situation correctly. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-rebase.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index 8a5f44a..c1619ff 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -6,6 +6,8 @@
USAGE='<upstream> [<head>]'
. git-sh-setup
+case $# in 1|2) ;; *) usage ;; esac
+
# Make sure we do not have .dotest
if mkdir .dotest
then
@@ -37,6 +39,7 @@ esac
# If the branch to rebase is given, first switch to it.
case "$#" in
2)
+ head=$(git-rev-parse --verify "$2^") || usage
git-checkout "$2" || usage
esac