From: Mike Hommey Date: Thu, 8 Nov 2007 07:03:06 +0000 (+0100) Subject: Do git reset --hard HEAD when using git rebase --skip X-Git-Tag: v1.5.4-rc0~155^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fb6e4e1f3f048898677f3cf177bfcaf60123bd5c;p=git.git Do git reset --hard HEAD when using git rebase --skip 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 Signed-off-by: Junio C Hamano --- diff --git a/git-rebase.sh b/git-rebase.sh index 224cca98e..9af9da992 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -157,6 +157,7 @@ do exit ;; --skip) + git reset --hard HEAD || exit $? if test -d "$dotest" then git rerere clear diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh index eab053c3e..becabfc33 100755 --- a/t/t3403-rebase-skip.sh +++ b/t/t3403-rebase-skip.sh @@ -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 '