Merge branch 'md/list-lazy-objects-fix'
[gitweb.git] / t / t3404-rebase-interactive.sh
index f6737e162f3aee38653efd659fabebe5697d08cf..7a440e08d8257487ae2f47b159d11e37a5166df8 100755 (executable)
@@ -322,7 +322,7 @@ test_expect_success 'retain authorship when squashing' '
        git show HEAD | grep "^Author: Twerp Snog"
 '
 
-test_expect_success '-p handles "no changes" gracefully' '
+test_expect_success REBASE_P '-p handles "no changes" gracefully' '
        HEAD=$(git rev-parse HEAD) &&
        set_fake_editor &&
        git rebase -i -p HEAD^ &&
@@ -332,7 +332,7 @@ test_expect_success '-p handles "no changes" gracefully' '
        test $HEAD = $(git rev-parse HEAD)
 '
 
-test_expect_failure 'exchange two commits with -p' '
+test_expect_failure REBASE_P 'exchange two commits with -p' '
        git checkout H &&
        set_fake_editor &&
        FAKE_LINES="2 1" git rebase -i -p HEAD~2 &&
@@ -340,7 +340,7 @@ test_expect_failure 'exchange two commits with -p' '
        test G = $(git cat-file commit HEAD | sed -ne \$p)
 '
 
-test_expect_success 'preserve merges with -p' '
+test_expect_success REBASE_P 'preserve merges with -p' '
        git checkout -b to-be-preserved master^ &&
        : > unrelated-file &&
        git add unrelated-file &&
@@ -383,7 +383,7 @@ test_expect_success 'preserve merges with -p' '
        test $(git show HEAD:unrelated-file) = 1
 '
 
-test_expect_success 'edit ancestor with -p' '
+test_expect_success REBASE_P 'edit ancestor with -p' '
        set_fake_editor &&
        FAKE_LINES="1 2 edit 3 4" git rebase -i -p HEAD~3 &&
        echo 2 > unrelated-file &&
@@ -397,6 +397,7 @@ test_expect_success 'edit ancestor with -p' '
 '
 
 test_expect_success '--continue tries to commit' '
+       git reset --hard D &&
        test_tick &&
        set_fake_editor &&
        test_must_fail git rebase -i --onto new-branch1 HEAD^ &&
@@ -436,7 +437,7 @@ test_expect_success C_LOCALE_OUTPUT 'multi-fixup does not fire up editor' '
                git rebase -i $base &&
        test $base = $(git rev-parse HEAD^) &&
        test 0 = $(git show | grep NEVER | wc -l) &&
-       git checkout to-be-rebased &&
+       git checkout @{-1} &&
        git branch -D multi-fixup
 '
 
@@ -451,7 +452,7 @@ test_expect_success 'commit message used after conflict' '
                git rebase --continue &&
        test $base = $(git rev-parse HEAD^) &&
        test 1 = $(git show | grep ONCE | wc -l) &&
-       git checkout to-be-rebased &&
+       git checkout @{-1} &&
        git branch -D conflict-fixup
 '
 
@@ -466,7 +467,7 @@ test_expect_success 'commit message retained after conflict' '
                git rebase --continue &&
        test $base = $(git rev-parse HEAD^) &&
        test 2 = $(git show | grep TWICE | wc -l) &&
-       git checkout to-be-rebased &&
+       git checkout @{-1} &&
        git branch -D conflict-squash
 '
 
@@ -491,7 +492,7 @@ test_expect_success C_LOCALE_OUTPUT 'squash and fixup generate correct log messa
                grep "^# This is a combination of 3 commits\."  &&
        git cat-file commit HEAD@{3} |
                grep "^# This is a combination of 2 commits\."  &&
-       git checkout to-be-rebased &&
+       git checkout @{-1} &&
        git branch -D squash-fixup
 '
 
@@ -504,7 +505,7 @@ test_expect_success C_LOCALE_OUTPUT 'squash ignores comments' '
                git rebase -i $base &&
        test $base = $(git rev-parse HEAD^) &&
        test 1 = $(git show | grep ONCE | wc -l) &&
-       git checkout to-be-rebased &&
+       git checkout @{-1} &&
        git branch -D skip-comments
 '
 
@@ -517,7 +518,7 @@ test_expect_success C_LOCALE_OUTPUT 'squash ignores blank lines' '
                git rebase -i $base &&
        test $base = $(git rev-parse HEAD^) &&
        test 1 = $(git show | grep ONCE | wc -l) &&
-       git checkout to-be-rebased &&
+       git checkout @{-1} &&
        git branch -D skip-blank-lines
 '
 
@@ -658,7 +659,7 @@ test_expect_success 'rebase with a file named HEAD in worktree' '
        ) &&
 
        set_fake_editor &&
-       FAKE_LINES="1 squash 2" git rebase -i to-be-rebased &&
+       FAKE_LINES="1 squash 2" git rebase -i @{-1} &&
        test "$(git show -s --pretty=format:%an)" = "Squashed Away"
 
 '