]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3404-rebase-interactive.sh
Merge branch 'en/sequencer-empty-edit-result-aborts'
[thirdparty/git.git] / t / t3404-rebase-interactive.sh
index 259c27233dff0e47e2e0d7ddd48ac8dc6742925b..ff89b6341a6fc19801959058e35039778bc6577b 100755 (executable)
@@ -569,16 +569,15 @@ test_expect_success '--continue tries to commit, even for "edit"' '
 '
 
 test_expect_success 'aborted --continue does not squash commits after "edit"' '
-       test_when_finished "git rebase --abort" &&
        old=$(git rev-parse HEAD) &&
        test_tick &&
        set_fake_editor &&
        FAKE_LINES="edit 1" git rebase -i HEAD^ &&
        echo "edited again" > file7 &&
        git add file7 &&
-       echo all the things >>conflict &&
-       test_must_fail git rebase --continue &&
-       test $old = $(git rev-parse HEAD)
+       test_must_fail env FAKE_COMMIT_MESSAGE=" " git rebase --continue &&
+       test $old = $(git rev-parse HEAD) &&
+       git rebase --abort
 '
 
 test_expect_success 'auto-amend only edited commits after "edit"' '
@@ -1426,9 +1425,21 @@ test_expect_success 'rebase -i --gpg-sign=<key-id> overrides commit.gpgSign' '
 test_expect_success 'valid author header after --root swap' '
        rebase_setup_and_clean author-header no-conflict-branch &&
        set_fake_editor &&
-       FAKE_LINES="2 1" git rebase -i --root &&
-       git cat-file commit HEAD^ >out &&
-       grep "^author ..*> [0-9][0-9]* [-+][0-9][0-9][0-9][0-9]$" out
+       git commit --amend --author="Au ${SQ}thor <author@example.com>" --no-edit &&
+       git cat-file commit HEAD | grep ^author >expected &&
+       FAKE_LINES="5 1" git rebase -i --root &&
+       git cat-file commit HEAD^ | grep ^author >actual &&
+       test_cmp expected actual
+'
+
+test_expect_success 'valid author header when author contains single quote' '
+       rebase_setup_and_clean author-header no-conflict-branch &&
+       set_fake_editor &&
+       git commit --amend --author="Au ${SQ}thor <author@example.com>" --no-edit &&
+       git cat-file commit HEAD | grep ^author >expected &&
+       FAKE_LINES="2" git rebase -i HEAD~2 &&
+       git cat-file commit HEAD | grep ^author >actual &&
+       test_cmp expected actual
 '
 
 test_done