Skip to content

Commit 34986b7

Browse files
avargitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9e2a14a commit 34986b7

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

t/t4203-mailmap.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,4 +838,31 @@ test_expect_success 'whitespace syntax: setup' '
838838
test_cmp expect actual
839839
'
840840

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 <[email protected]>" B &&
845+
test_commit -C empty --author "C <[email protected]>" C &&
846+
847+
test_config -C empty mailmap.file ../empty.map &&
848+
cat >>empty.map <<-\EOF &&
849+
850+
851+
852+
EOF
853+
854+
cat >expect <<-\EOF &&
855+
Author A <> maps to Bee <[email protected]>
856+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
857+
858+
Author B <[email protected]> maps to B <[email protected]>
859+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
860+
861+
Author C <[email protected]> maps to C <[email protected]>
862+
Committer C O Mitter <[email protected]> maps to C O Mitter <[email protected]>
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+
841868
test_done

0 commit comments

Comments
 (0)