]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3404-rebase-interactive.sh
Merge branch 'pw/rebase-i-author-script-fix'
[thirdparty/git.git] / t / t3404-rebase-interactive.sh
index 4c7b1ea3563274c7c3551e417c819b70200e90e9..86bba5ed7c23f78065521a9042244ea978a3a80f 100755 (executable)
@@ -796,16 +796,15 @@ test_expect_success 'always cherry-pick with --no-ff' '
        git tag original-no-ff-branch &&
        set_fake_editor &&
        git rebase -i --no-ff A &&
-       touch empty &&
        for p in 0 1 2
        do
                test ! $(git rev-parse HEAD~$p) = $(git rev-parse original-no-ff-branch~$p) &&
                git diff HEAD~$p original-no-ff-branch~$p > out &&
-               test_cmp empty out
+               test_must_be_empty out
        done &&
        test $(git rev-parse HEAD~3) = $(git rev-parse original-no-ff-branch~3) &&
        git diff HEAD~3 original-no-ff-branch~3 > out &&
-       test_cmp empty out
+       test_must_be_empty out
 '
 
 test_expect_success 'set up commits with funny messages' '
@@ -1427,9 +1426,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