diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-26 15:28:34 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-26 15:28:34 -0700 |
commit | d1ab71804fe2afff4afa664c46a938a72fd237a7 (patch) | |
tree | ec51114efc56db221b29fc792c003fc3a8caa1db | |
parent | 019eb0dd351ee53b875df27f6748bcb69dc02063 (diff) | |
parent | ea709800302ecae8c2fbb03af01e36b7f9b4d042 (diff) | |
download | git-d1ab71804fe2afff4afa664c46a938a72fd237a7.tar.gz git-d1ab71804fe2afff4afa664c46a938a72fd237a7.tar.xz |
Merge branch 'ph/rebase-original'
* ph/rebase-original:
rebase: find orig_head unambiguously
-rwxr-xr-x | git-rebase.sh | 2 | ||||
-rwxr-xr-x | t/t3400-rebase.sh | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/git-rebase.sh b/git-rebase.sh index b2f1c76dc..2c692c33e 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -473,7 +473,7 @@ case "$#" in head_name="detached HEAD" branch_name=HEAD ;# detached fi - orig_head=$(git rev-parse --verify "${branch_name}^0") || exit + orig_head=$(git rev-parse --verify HEAD) || exit ;; *) die "BUG: unexpected number of arguments left to parse" diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh index f6cc10265..b58fa1a23 100755 --- a/t/t3400-rebase.sh +++ b/t/t3400-rebase.sh @@ -101,7 +101,14 @@ test_expect_success 'HEAD was detached during rebase' ' test $(git rev-parse HEAD@{1}) != $(git rev-parse my-topic-branch@{1}) ' +test_expect_success 'rebase from ambiguous branch name' ' + git checkout -b topic side && + git rebase master +' + test_expect_success 'rebase after merge master' ' + git checkout --detach refs/tags/topic && + git branch -D topic && git reset --hard topic && git merge master && git rebase master && |