diff options
Diffstat (limited to 't')
| -rwxr-xr-x | t/t3404-rebase-interactive.sh | 12 | ||||
| -rwxr-xr-x | t/t7502-commit-porcelain.sh | 37 |
2 files changed, 45 insertions, 4 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 3b2a46c25c..cc97628d81 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -1186,9 +1186,19 @@ test_expect_success !WITH_BREAKING_CHANGES 'rebase -i respects core.commentchar= test_set_editor "$(pwd)/copy-edit-script.sh" && git rebase -i HEAD^ 2>err ) && - sed -n "s/^warning: //p" err >actual && + sed -n "s/^hint: *\$//p; s/^hint: //p; s/^warning: //p" err >actual && cat >expect <<-EOF && Support for ${SQ}core.commentChar=auto${SQ} is deprecated and will be removed in Git 3.0 + + To use the default comment string (#) please run + + git config unset core.commentChar + + To set a custom comment string please run + + git config set core.commentChar <comment string> + + where ${SQ}<comment string>${SQ} is the string you wish to use. EOF test_cmp expect actual && test -z "$(grep -ve "^#" -e "^\$" -e "^pick" edit-script)" diff --git a/t/t7502-commit-porcelain.sh b/t/t7502-commit-porcelain.sh index a9dc1e416d..05f6da4ad9 100755 --- a/t/t7502-commit-porcelain.sh +++ b/t/t7502-commit-porcelain.sh @@ -958,10 +958,31 @@ test_expect_success 'commit --status with custom comment character' ' test_expect_success !WITH_BREAKING_CHANGES 'switch core.commentchar' ' test_commit "#foo" foo && - GIT_EDITOR=.git/FAKE_EDITOR git -c core.commentChar=auto commit --amend 2>err && - sed -n "s/^warning: //p" err >actual && + cat >config-include <<-\EOF && + [core] + commentString=: + commentString=% + commentChar=auto + EOF + test_when_finished "rm config-include" && + test_config include.path "$(pwd)/config-include" && + test_config core.commentChar ! && + GIT_EDITOR=.git/FAKE_EDITOR git commit --amend 2>err && + sed -n "s/^hint: *\$//p; s/^hint: //p; s/^warning: //p" err >actual && cat >expect <<-EOF && Support for ${SQ}core.commentChar=auto${SQ} is deprecated and will be removed in Git 3.0 + + To use the default comment string (#) please run + + git config unset core.commentChar + git config unset --file ~/config-include --all core.commentString + git config unset --file ~/config-include core.commentChar + + To set a custom comment string please run + + git config set --file ~/config-include core.commentChar <comment string> + + where ${SQ}<comment string>${SQ} is the string you wish to use. EOF test_cmp expect actual && test_grep "^; Changes to be committed:" .git/COMMIT_EDITMSG @@ -990,9 +1011,19 @@ EOF test_expect_success WITH_BREAKING_CHANGES 'core.commentChar=auto is rejected' ' test_config core.commentChar auto && test_must_fail git rev-parse --git-dir 2>err && - sed -n "s/^fatal: //p" err >actual && + sed -n "s/^hint: *\$//p; s/^hint: //p; s/^fatal: //p" err >actual && cat >expect <<-EOF && Support for ${SQ}core.commentChar=auto${SQ} has been removed in Git 3.0 + + To use the default comment string (#) please run + + git config unset core.commentChar + + To set a custom comment string please run + + git config set core.commentChar <comment string> + + where ${SQ}<comment string>${SQ} is the string you wish to use. EOF test_cmp expect actual ' |
