From: Ævar Arnfjörð Bjarmason Date: Tue, 12 Jan 2021 20:18:04 +0000 (+0100) Subject: mailmap tests: add tests for empty "<>" syntax X-Git-Tag: v2.31.0-rc0~99^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=34986b773a0ebe0298965b64c801dd983cba29e6;p=thirdparty%2Fgit.git 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 " " pair. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- 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 && + test_commit -C empty --author "C " C && + + test_config -C empty mailmap.file ../empty.map && + cat >>empty.map <<-\EOF && + Ah <> + Bee <> + Cee <> + EOF + + cat >expect <<-\EOF && + Author A <> maps to Bee + Committer C O Mitter maps to C O Mitter + + Author B maps to B + Committer C O Mitter maps to C O Mitter + + Author C maps to C + Committer C O Mitter maps to C O Mitter + 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