diff options
author | Philippe Blain <levraiphilippeblain@gmail.com> | 2020-10-29 15:48:29 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-10-29 22:57:45 +0300 |
commit | e2f89586fa6d22bfb176e2f679584464fa1a282d (patch) | |
tree | 87015fbde1abee002474c94a8ae10ccd1879f5db /t/t3920-crlf-messages.sh | |
parent | 9f75ce3d8f2666ea82913a88d7068f28893b23a8 (diff) |
log, show: add tests for messages containing CRLF
A previous commit adjusted the code in ref-filter.c so that messages
containing CRLF are now correctly parsed and displayed.
Add tests to also check that `git log` and `git show` correctly handle
such messages, to prevent futur regressions if these commands are
refactored to use the ref-filter API.
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3920-crlf-messages.sh')
-rwxr-xr-x | t/t3920-crlf-messages.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh index 3f0ce02c3f..70ddce3a2e 100755 --- a/t/t3920-crlf-messages.sh +++ b/t/t3920-crlf-messages.sh @@ -105,4 +105,22 @@ test_crlf_subject_body_and_contents tag --list tag-crlf* test_crlf_subject_body_and_contents for-each-ref refs/heads/crlf* +test_expect_success 'log: --oneline works with messages using CRLF' ' + for branch in $LIB_CRLF_BRANCHES + do + cat .crlf-subject-${branch}.txt >expect && + printf "\n" >>expect && + git log --oneline -1 ${branch} >tmp-branch && + git log --oneline -1 tag-${branch} >tmp-tag && + cut -d" " -f2- <tmp-branch >actual-branch && + cut -d" " -f2- <tmp-tag >actual-tag && + test_cmp expect actual-branch && + test_cmp expect actual-tag || return 1 + done +' + +test_crlf_subject_body_and_contents log --all --reverse --grep Subject + +test_crlf_subject_body_and_contents show $LIB_CRLF_BRANCHES + test_done |