Skip to content

Commit

Permalink
Merge branch 'ph/rebase-original'
Browse files Browse the repository at this point in the history
* ph/rebase-original:
  rebase: find orig_head unambiguously
  • Loading branch information
Junio C Hamano committed Apr 26, 2013
2 parents 019eb0d + ea70980 commit d1ab718
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 7 additions & 0 deletions t/t3400-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit d1ab718

Please sign in to comment.