]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Do git reset --hard HEAD when using git rebase --skip
authorMike Hommey <mh@glandium.org>
Thu, 8 Nov 2007 07:03:06 +0000 (08:03 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Nov 2007 01:04:59 +0000 (17:04 -0800)
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>
git-rebase.sh
t/t3403-rebase-skip.sh

index 224cca98eea324cabf30885f7c92c254b184410b..9af9da992fae7c6d5aaf3f553e684db623060a97 100755 (executable)
@@ -157,6 +157,7 @@ do
                exit
                ;;
        --skip)
+               git reset --hard HEAD || exit $?
                if test -d "$dotest"
                then
                        git rerere clear
index eab053c3e0e1cbe82bc7824d43109ba56acdb54d..becabfc33c6e392c9d8fca231a6d2b99b3e80a29 100755 (executable)
@@ -36,7 +36,6 @@ 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'
@@ -44,7 +43,6 @@ 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
        '