Skip to content

Commit 9b391b0

Browse files
avargitster
authored andcommitted
mailmap tests: add a test for comment syntax
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 <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 05b5ff2 commit 9b391b0

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

t/t4203-mailmap.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,4 +753,37 @@ test_expect_success 'commit --author honors mailmap' '
753753
test_cmp expect actual
754754
'
755755

756+
test_expect_success 'comment syntax: setup' '
757+
test_create_repo comm &&
758+
test_commit -C comm --author "A <[email protected]>" A &&
759+
test_commit -C comm --author "B <[email protected]>" B &&
760+
test_commit -C comm --author "C <#@example.com>" C &&
761+
test_commit -C comm --author "D <d@e#ample.com>" D &&
762+
763+
test_config -C comm mailmap.file ../doc.map &&
764+
cat >>doc.map <<-\EOF &&
765+
766+
767+
768+
Cee <[email protected]> <#@example.com>
769+
Dee <[email protected]> <d@e#ample.com>
770+
EOF
771+
772+
cat >expect <<-\EOF &&
773+
Author A <[email protected]> maps to A <[email protected]>
774+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
775+
776+
Author B <[email protected]> maps to ; Bee <[email protected]>
777+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
778+
779+
Author C <#@example.com> maps to Cee <[email protected]>
780+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
781+
782+
Author D <d@e#ample.com> maps to Dee <[email protected]>
783+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
784+
EOF
785+
git -C comm log --reverse --pretty=format:"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n" >actual &&
786+
test_cmp expect actual
787+
'
788+
756789
test_done

0 commit comments

Comments
 (0)