Skip to content

Commit

Permalink
Do git reset --hard HEAD when using git rebase --skip
Browse files Browse the repository at this point in the history
When you have a merge conflict and want to bypass the commit causing it,
you don't want to care about the dirty state of the working tree.

Also, don't git reset --hard HEAD in the rebase-skip test, so that the
lack of support for this is detected.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Mike Hommey authored and Junio C Hamano committed Nov 12, 2007
1 parent 40e2524 commit fb6e4e1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ do
exit
;;
--skip)
git reset --hard HEAD || exit $?
if test -d "$dotest"
then
git rerere clear
Expand Down
2 changes: 0 additions & 2 deletions t/t3403-rebase-skip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ test_expect_failure 'rebase with git am -3 (default)' '
'

test_expect_success 'rebase --skip with am -3' '
git reset --hard HEAD &&
git rebase --skip
'
test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge'

test_expect_failure 'rebase with --merge' 'git rebase --merge master'

test_expect_success 'rebase --skip with --merge' '
git reset --hard HEAD &&
git rebase --skip
'

Expand Down

0 comments on commit fb6e4e1

Please sign in to comment.