format-patch: respect --stat in cover letter's diffstat
[gitweb.git] / t / t5520-pull.sh
index 59c4b778d3a455b6ef4575a4b07b860d1e84720d..5e501c8b08868b17478b8baa91db2cd129cd1c67 100755 (executable)
@@ -475,10 +475,22 @@ test_expect_success 'pull.rebase=interactive' '
        false
        EOF
        test_set_editor "$TRASH_DIRECTORY/fake-editor" &&
+       test_when_finished "test_might_fail git rebase --abort" &&
        test_must_fail git pull --rebase=interactive . copy &&
        test "I was here" = "$(cat fake.out)"
 '
 
+test_expect_success 'pull --rebase=i' '
+       write_script "$TRASH_DIRECTORY/fake-editor" <<-\EOF &&
+       echo I was here, too >fake.out &&
+       false
+       EOF
+       test_set_editor "$TRASH_DIRECTORY/fake-editor" &&
+       test_when_finished "test_might_fail git rebase --abort" &&
+       test_must_fail git pull --rebase=i . copy &&
+       test "I was here, too" = "$(cat fake.out)"
+'
+
 test_expect_success 'pull.rebase=invalid fails' '
        git reset --hard before-preserve-rebase &&
        test_config pull.rebase invalid &&
@@ -618,6 +630,18 @@ test_expect_success 'pull --rebase fails on unborn branch with staged changes' '
        )
 '
 
+test_expect_success 'pull --rebase fails on corrupt HEAD' '
+       test_when_finished "rm -rf corrupt" &&
+       git init corrupt &&
+       (
+               cd corrupt &&
+               test_commit one &&
+               obj=$(git rev-parse --verify HEAD | sed "s#^..#&/#") &&
+               rm -f .git/objects/$obj &&
+               test_must_fail git pull --rebase
+       )
+'
+
 test_expect_success 'setup for detecting upstreamed changes' '
        mkdir src &&
        (cd src &&