From 9b391b09a084d49a71d29f1a90637252db427cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 12 Jan 2021 21:18:02 +0100 Subject: [PATCH] mailmap tests: add a test for comment syntax MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a test for mailmap comment syntax. As noted in [1] there was no test coverage for this. Let's make sure a future change doesn't break it. 1. https://lore.kernel.org/git/CAN0heSoKYWXqskCR=GPreSHc6twCSo1345WTmiPdrR57XSShhA@mail.gmail.com/ Reported-by: Martin Ågren Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- t/t4203-mailmap.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index 96ba5367c6..10e672e006 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -753,4 +753,37 @@ test_expect_success 'commit --author honors mailmap' ' test_cmp expect actual ' +test_expect_success 'comment syntax: setup' ' + test_create_repo comm && + test_commit -C comm --author "A " A && + test_commit -C comm --author "B " B && + test_commit -C comm --author "C <#@example.com>" C && + test_commit -C comm --author "D " D && + + test_config -C comm mailmap.file ../doc.map && + cat >>doc.map <<-\EOF && + # Ah + + ; Bee + Cee <#@example.com> + Dee + EOF + + cat >expect <<-\EOF && + Author A maps to A + Committer C O Mitter maps to C O Mitter + + Author B maps to ; Bee + Committer C O Mitter maps to C O Mitter + + Author C <#@example.com> maps to Cee + Committer C O Mitter maps to C O Mitter + + Author D maps to Dee + Committer C O Mitter maps to C O Mitter + EOF + git -C comm log --reverse --pretty=format:"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n" >actual && + test_cmp expect actual +' + test_done