mailmap tests: add tests for empty "<>" syntax
Add tests for mailmap's handling of "<>", which is allowed on the RHS, but not the LHS of a "<LHS> <RHS>" pair. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Jan 12, 2021 at 21:18 UTC
34986b773a0ebe0298965b64c801dd983cba29e6
1 file changed
+27
t/t4203-mailmap.sh
+27
@@ -838,4 +838,31 @@ test_expect_success 'whitespace syntax: setup' '
838
test_cmp expect actual
839
'
840
841
+test_expect_success 'empty syntax: setup' '
842
+ test_create_repo empty &&
843
+ test_commit -C empty --author "A <>" A &&
844
+ test_commit -C empty --author "B <b@example.com>" B &&
845
+ test_commit -C empty --author "C <c@example.com>" C &&
846
+
847
+ test_config -C empty mailmap.file ../empty.map &&
848
+ cat >>empty.map <<-\EOF &&
849
+ Ah <ah@example.com> <>
850
+ Bee <bee@example.com> <>
851
+ Cee <> <c@example.com>
852
+ EOF
853
+
854
+ cat >expect <<-\EOF &&
855
+ Author A <> maps to Bee <bee@example.com>
856
+ Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
857
+
858
+ Author B <b@example.com> maps to B <b@example.com>
859
+ Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
860
+
861
+ Author C <c@example.com> maps to C <c@example.com>
862
+ Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
863
+ EOF
864
+ git -C empty log --reverse --pretty=format:"Author %an <%ae> maps to %aN <%aE>%nCommitter %cn <%ce> maps to %cN <%cE>%n" >actual &&
865
+ test_cmp expect actual
866
+'
867
+
868
test_done