summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-01-12 20:18:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-12 22:04:42 (GMT)
commit9b391b09a084d49a71d29f1a90637252db427cbd (patch)
treede09a396102b10cefd64326c4d2627fc8dc0ff76 /t
parent05b5ff219c22ca8b3abb7fed3e4dcaf41fe46018 (diff)
downloadgit-9b391b09a084d49a71d29f1a90637252db427cbd.zip
git-9b391b09a084d49a71d29f1a90637252db427cbd.tar.gz
git-9b391b09a084d49a71d29f1a90637252db427cbd.tar.bz2
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 <martin.agren@gmail.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4203-mailmap.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 96ba536..10e672e 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@example.com>" A &&
+ test_commit -C comm --author "B <b@example.com>" B &&
+ test_commit -C comm --author "C <#@example.com>" C &&
+ test_commit -C comm --author "D <d@e#ample.com>" D &&
+
+ test_config -C comm mailmap.file ../doc.map &&
+ cat >>doc.map <<-\EOF &&
+ # Ah <a@example.com>
+
+ ; Bee <b@example.com>
+ Cee <cee@example.com> <#@example.com>
+ Dee <dee@example.com> <d@e#ample.com>
+ EOF
+
+ cat >expect <<-\EOF &&
+ Author A <a@example.com> maps to A <a@example.com>
+ Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
+
+ Author B <b@example.com> maps to ; Bee <b@example.com>
+ Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
+
+ Author C <#@example.com> maps to Cee <cee@example.com>
+ Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
+
+ Author D <d@e#ample.com> maps to Dee <dee@example.com>
+ Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
+ 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