Skip to content

Commit

Permalink
rebase: fix "rebase --continue" breakage
Browse files Browse the repository at this point in the history
The --skip case was handled properly when rebasing without --merge,
but the --continue case was not.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Nov 13, 2007
1 parent 6fd2f5e commit 3f735b6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ do
finish_rb_merge
exit
fi
git am --resolved --3way --resolvemsg="$RESOLVEMSG"
head_name=$(cat .dotest/head-name) &&
onto=$(cat .dotest/onto) &&
orig_head=$(cat .dotest/orig-head) &&
git am --resolved --3way --resolvemsg="$RESOLVEMSG" &&
move_to_original_branch
exit
;;
--skip)
Expand Down
17 changes: 17 additions & 0 deletions t/t3403-rebase-skip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ test_expect_success 'rebase --skip with am -3' '
git reset --hard HEAD &&
git rebase --skip
'

test_expect_success 'rebase moves back to skip-reference' '
test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
git branch post-rebase &&
git reset --hard pre-rebase &&
! git rebase master &&
echo "hello" > hello &&
git add hello &&
git rebase --continue &&
test refs/heads/skip-reference = $(git symbolic-ref HEAD) &&
git reset --hard post-rebase
'

test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'

test_expect_failure 'rebase with --merge' 'git rebase --merge master'
Expand All @@ -51,6 +64,10 @@ test_expect_success 'rebase --skip with --merge' '
test_expect_success 'merge and reference trees equal' \
'test -z "`git diff-tree skip-merge skip-reference`"'

test_expect_success 'moved back to branch correctly' '
test refs/heads/skip-merge = $(git symbolic-ref HEAD)
'

test_debug 'gitk --all & sleep 1'

test_done

0 comments on commit 3f735b6

Please sign in to comment.