diff options
-rwxr-xr-x | git-rebase.sh | 8 | ||||
-rwxr-xr-x | t/t3400-rebase.sh | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/git-rebase.sh b/git-rebase.sh index 658c003c14..80f2630479 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -451,7 +451,13 @@ then *) upstream_name="$1" if test "$upstream_name" = "-" then - upstream_name="@{-1}" + upstream_name=`git rev-parse --symbolic-full-name @{-1}` + if test -n "$upstream_name" + then + upstream_name=${upstream_name#refs/heads/} + else + upstream_name="@{-1}" + fi fi shift ;; diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh index 80e0a951ea..2b999402f2 100755 --- a/t/t3400-rebase.sh +++ b/t/t3400-rebase.sh @@ -91,7 +91,7 @@ test_expect_success 'rebase from ambiguous branch name' ' test_expect_success 'rebase off of the previous branch using "-"' ' git checkout master && git checkout HEAD^ && - git rebase @{-1} >expect.messages && + git rebase master >expect.messages && git merge-base master HEAD >expect.forkpoint && git checkout master && @@ -100,8 +100,6 @@ test_expect_success 'rebase off of the previous branch using "-"' ' git merge-base master HEAD >actual.forkpoint && test_cmp expect.forkpoint actual.forkpoint && - # the next one is dubious---we may want to say "-", - # instead of @{-1}, in the message test_i18ncmp expect.messages actual.messages ' |