Merge branch 'pb/stash-refuse-to-kill'
[gitweb.git] / t / t3404-rebase-interactive.sh
index 15dcbd42d367c3ef6b487e0f235ad201b6cf8413..d6b414377306de88e8e294dd5eaadfcb3a234ec2 100755 (executable)
@@ -477,19 +477,11 @@ test_expect_success 'interrupted squash works as expected (case 2)' '
        test $one = $(git rev-parse HEAD~2)
 '
 
-test_expect_success 'ignore patch if in upstream' '
-       HEAD=$(git rev-parse HEAD) &&
-       git checkout -b has-cherry-picked HEAD^ &&
+test_expect_success '--continue tries to commit, even for "edit"' '
        echo unrelated > file7 &&
        git add file7 &&
        test_tick &&
        git commit -m "unrelated change" &&
-       git cherry-pick $HEAD &&
-       EXPECT_COUNT=1 git rebase -i $HEAD &&
-       test $HEAD = $(git rev-parse HEAD^)
-'
-
-test_expect_success '--continue tries to commit, even for "edit"' '
        parent=$(git rev-parse HEAD^) &&
        test_tick &&
        FAKE_LINES="edit 1" git rebase -i HEAD^ &&
@@ -692,7 +684,7 @@ test_expect_success 'rebase -i can copy notes' '
        test_commit n2 &&
        test_commit n3 &&
        git notes add -m"a note" n3 &&
-       git rebase --onto n1 n2 &&
+       git rebase -i --onto n1 n2 &&
        test "a note" = "$(git notes show HEAD)"
 '
 
@@ -937,8 +929,7 @@ test_expect_success 'rebase --edit-todo can be used to modify todo' '
 test_expect_success 'rebase -i respects core.commentchar' '
        git reset --hard &&
        git checkout E^0 &&
-       git config core.commentchar "\\" &&
-       test_when_finished "git config --unset core.commentchar" &&
+       test_config core.commentchar "\\" &&
        write_script remove-all-but-first.sh <<-\EOF &&
        sed -e "2,\$s/^/\\\\/" "$1" >"$1.tmp" &&
        mv "$1.tmp" "$1"
@@ -948,4 +939,15 @@ test_expect_success 'rebase -i respects core.commentchar' '
        test B = $(git cat-file commit HEAD^ | sed -ne \$p)
 '
 
+test_expect_success 'rebase -i, with <onto> and <upstream> specified as :/quuxery' '
+       test_when_finished "git branch -D torebase" &&
+       git checkout -b torebase branch1 &&
+       upstream=$(git rev-parse ":/J") &&
+       onto=$(git rev-parse ":/A") &&
+       git rebase --onto $onto $upstream &&
+       git reset --hard branch1 &&
+       git rebase --onto ":/A" ":/J" &&
+       git checkout branch1
+'
+
 test_done