diff options
Diffstat (limited to 't/t7502-commit-porcelain.sh')
-rwxr-xr-x | t/t7502-commit-porcelain.sh | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/t/t7502-commit-porcelain.sh b/t/t7502-commit-porcelain.sh index 38a532d81c..61c8e810cc 100755 --- a/t/t7502-commit-porcelain.sh +++ b/t/t7502-commit-porcelain.sh @@ -466,6 +466,25 @@ test_expect_success 'commit --trailer with -c and command' ' test_cmp expected actual ' +test_expect_success 'commit --trailer not confused by --- separator' ' + cat >msg <<-\EOF && + subject + + body with dashes + --- + in it + EOF + git commit --allow-empty --trailer="my-trailer: value" -F msg && + { + cat msg && + echo && + echo "my-trailer: value" + } >expected && + git cat-file commit HEAD >commit.msg && + sed -e "1,/^\$/d" commit.msg >actual && + test_cmp expected actual +' + test_expect_success 'multiple -m' ' >negative && @@ -687,14 +706,14 @@ test_expect_success 'cleanup commit message (whitespace config, -m)' ' test_expect_success 'message shows author when it is not equal to committer' ' echo >>negative && git commit -e -m "sample" -a && - test_i18ngrep \ + test_grep \ "^# Author: *A U Thor <author@example.com>\$" \ .git/COMMIT_EDITMSG ' test_expect_success 'message shows date when it is explicitly set' ' git commit --allow-empty -e -m foo --date="2010-01-02T03:04:05" && - test_i18ngrep \ + test_grep \ "^# Date: *Sat Jan 2 03:04:05 2010 +0000" \ .git/COMMIT_EDITMSG ' @@ -709,7 +728,7 @@ test_expect_success AUTOIDENT 'message shows committer when it is automatic' ' ) && # the ident is calculated from the system, so we cannot # check the actual value, only that it is there - test_i18ngrep "^# Committer: " .git/COMMIT_EDITMSG + test_grep "^# Committer: " .git/COMMIT_EDITMSG ' write_script .git/FAKE_EDITOR <<EOF @@ -841,9 +860,9 @@ try_commit () { GIT_EDITOR=.git/FAKE_EDITOR git commit -a $* $use_template && case "$use_template" in '') - test_i18ngrep ! "^## Custom template" .git/COMMIT_EDITMSG ;; + test_grep ! "^## Custom template" .git/COMMIT_EDITMSG ;; *) - test_i18ngrep "^## Custom template" .git/COMMIT_EDITMSG ;; + test_grep "^## Custom template" .git/COMMIT_EDITMSG ;; esac } @@ -851,53 +870,53 @@ try_commit_status_combo () { test_expect_success 'commit' ' try_commit "" && - test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG + test_grep "^# Changes to be committed:" .git/COMMIT_EDITMSG ' test_expect_success 'commit --status' ' try_commit --status && - test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG + test_grep "^# Changes to be committed:" .git/COMMIT_EDITMSG ' test_expect_success 'commit --no-status' ' try_commit --no-status && - test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG + test_grep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG ' test_expect_success 'commit with commit.status = yes' ' test_config commit.status yes && try_commit "" && - test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG + test_grep "^# Changes to be committed:" .git/COMMIT_EDITMSG ' test_expect_success 'commit with commit.status = no' ' test_config commit.status no && try_commit "" && - test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG + test_grep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG ' test_expect_success 'commit --status with commit.status = yes' ' test_config commit.status yes && try_commit --status && - test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG + test_grep "^# Changes to be committed:" .git/COMMIT_EDITMSG ' test_expect_success 'commit --no-status with commit.status = yes' ' test_config commit.status yes && try_commit --no-status && - test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG + test_grep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG ' test_expect_success 'commit --status with commit.status = no' ' test_config commit.status no && try_commit --status && - test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG + test_grep "^# Changes to be committed:" .git/COMMIT_EDITMSG ' test_expect_success 'commit --no-status with commit.status = no' ' test_config commit.status no && try_commit --no-status && - test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG + test_grep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG ' } @@ -911,13 +930,13 @@ try_commit_status_combo test_expect_success 'commit --status with custom comment character' ' test_config core.commentchar ";" && try_commit --status && - test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG + test_grep "^; Changes to be committed:" .git/COMMIT_EDITMSG ' test_expect_success 'switch core.commentchar' ' test_commit "#foo" foo && GIT_EDITOR=.git/FAKE_EDITOR git -c core.commentChar=auto commit --amend && - test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG + test_grep "^; Changes to be committed:" .git/COMMIT_EDITMSG ' test_expect_success 'switch core.commentchar but out of options' ' |