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@xxxxxxxxx> --- t/t4203-mailmap.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index 4f61655c04..f19736fef1 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -838,4 +838,31 @@ test_expect_success 'whitespace syntax: setup' ' test_cmp expect actual ' +test_expect_success 'empty syntax: setup' ' + test_create_repo empty && + test_commit -C empty --author "A <>" A && + test_commit -C empty --author "B <b@xxxxxxxxxxx>" B && + test_commit -C empty --author "C <c@xxxxxxxxxxx>" C && + + test_config -C empty mailmap.file ../empty.map && + cat >>empty.map <<-\EOF && + Ah <ah@xxxxxxxxxxx> <> + Bee <bee@xxxxxxxxxxx> <> + Cee <> <c@xxxxxxxxxxx> + EOF + + cat >expect <<-\EOF && + Author A <> maps to Bee <bee@xxxxxxxxxxx> + Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx> + + Author B <b@xxxxxxxxxxx> maps to B <b@xxxxxxxxxxx> + Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx> + + Author C <c@xxxxxxxxxxx> maps to C <c@xxxxxxxxxxx> + Committer C O Mitter <committer@xxxxxxxxxxx> maps to C O Mitter <committer@xxxxxxxxxxx> + EOF + git -C empty 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 -- 2.29.2.222.g5d2a92d10f8