]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3404-rebase-interactive.sh
sequencer: fix --allow-empty-message behavior, make it smarter
[thirdparty/git.git] / t / t3404-rebase-interactive.sh
index 59c766540e5361af0eab19e33d1d61ef650bc72d..352a52e59d1a25d6fe50c5001ba3c84e2fc4a30c 100755 (executable)
@@ -971,6 +971,16 @@ test_expect_success 'rebase -i --root fixup root commit' '
        test 0 = $(git cat-file commit HEAD | grep -c ^parent\ )
 '
 
+test_expect_success 'rebase -i --root reword root commit' '
+       test_when_finished "test_might_fail git rebase --abort" &&
+       git checkout -b reword-root-branch master &&
+       set_fake_editor &&
+       FAKE_LINES="reword 1 2" FAKE_COMMIT_MESSAGE="A changed" \
+       git rebase -i --root &&
+       git show HEAD^ | grep "A changed" &&
+       test -z "$(git show -s --format=%p HEAD^)"
+'
+
 test_expect_success C_LOCALE_OUTPUT 'rebase --edit-todo does not work on non-interactive rebase' '
        git reset --hard &&
        git checkout conflict-branch &&
@@ -1204,10 +1214,6 @@ test_expect_success 'drop' '
        test A = $(git cat-file commit HEAD^^ | sed -ne \$p)
 '
 
-cat >expect <<EOF
-Successfully rebased and updated refs/heads/missing-commit.
-EOF
-
 test_expect_success 'rebase -i respects rebase.missingCommitsCheck = ignore' '
        test_config rebase.missingCommitsCheck ignore &&
        rebase_setup_and_clean missing-commit &&
@@ -1215,7 +1221,9 @@ test_expect_success 'rebase -i respects rebase.missingCommitsCheck = ignore' '
        FAKE_LINES="1 2 3 4" \
                git rebase -i --root 2>actual &&
        test D = $(git cat-file commit HEAD | sed -ne \$p) &&
-       test_i18ncmp expect actual
+       test_i18ngrep \
+               "Successfully rebased and updated refs/heads/missing-commit" \
+               actual
 '
 
 cat >expect <<EOF
@@ -1227,15 +1235,24 @@ To avoid this message, use "drop" to explicitly remove a commit.
 Use 'git config rebase.missingCommitsCheck' to change the level of warnings.
 The possible behaviours are: ignore, warn, error.
 
+Rebasing (1/4)
+Rebasing (2/4)
+Rebasing (3/4)
+Rebasing (4/4)
 Successfully rebased and updated refs/heads/missing-commit.
 EOF
 
+cr_to_nl () {
+       tr '\015' '\012'
+}
+
 test_expect_success 'rebase -i respects rebase.missingCommitsCheck = warn' '
        test_config rebase.missingCommitsCheck warn &&
        rebase_setup_and_clean missing-commit &&
        set_fake_editor &&
        FAKE_LINES="1 2 3 4" \
-               git rebase -i --root 2>actual &&
+               git rebase -i --root 2>actual.2 &&
+       cr_to_nl <actual.2 >actual &&
        test_i18ncmp expect actual &&
        test D = $(git cat-file commit HEAD | sed -ne \$p)
 '