test prerequisites: enumerate with commas
[gitweb.git] / t / t3420-rebase-autostash.sh
index 479cbb215fc90e5d5741fca830c62b8b4e8121e1..d783f03d3fc581eed08d8d2593e20ced3cbae200 100755 (executable)
@@ -141,8 +141,45 @@ testrebase() {
        '
 }
 
+test_expect_success "rebase: fast-forward rebase" '
+       test_config rebase.autostash true &&
+       git reset --hard &&
+       git checkout -b behind-feature-branch feature-branch~1 &&
+       test_when_finished git branch -D behind-feature-branch &&
+       echo dirty >>file1 &&
+       git rebase feature-branch &&
+       grep dirty file1 &&
+       git checkout feature-branch
+'
+
+test_expect_success "rebase: noop rebase" '
+       test_config rebase.autostash true &&
+       git reset --hard &&
+       git checkout -b same-feature-branch feature-branch &&
+       test_when_finished git branch -D same-feature-branch &&
+       echo dirty >>file1 &&
+       git rebase feature-branch &&
+       grep dirty file1 &&
+       git checkout feature-branch
+'
+
 testrebase "" .git/rebase-apply
 testrebase " --merge" .git/rebase-merge
 testrebase " --interactive" .git/rebase-merge
 
+test_expect_success 'abort rebase -i with --autostash' '
+       test_when_finished "git reset --hard" &&
+       echo uncommited-content >file0 &&
+       (
+               write_script abort-editor.sh <<-\EOF &&
+                       echo >"$1"
+               EOF
+               test_set_editor "$(pwd)/abort-editor.sh" &&
+               test_must_fail git rebase -i --autostash HEAD^ &&
+               rm -f abort-editor.sh
+       ) &&
+       echo uncommited-content >expected &&
+       test_cmp expected file0
+'
+
 test_done