From: Ævar Arnfjörð Bjarmason Date: Tue, 12 Jan 2021 20:18:03 +0000 (+0100) Subject: mailmap tests: add tests for whitespace syntax X-Git-Tag: v2.31.0-rc0~99^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e2a14a88953da80cba75ddde4488a88402e7c8b;p=thirdparty%2Fgit.git mailmap tests: add tests for whitespace syntax Add tests for mailmap's handling of whitespace, i.e. how it trims space within "<>" and around author names. 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 10e672e006..4f61655c04 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -786,4 +786,56 @@ test_expect_success 'comment syntax: setup' ' test_cmp expect actual ' +test_expect_success 'whitespace syntax: setup' ' + test_create_repo space && + test_commit -C space --author "A " A && + test_commit -C space --author "B " B && + test_commit -C space --author " C " C && + test_commit -C space --author " D " D && + test_commit -C space --author "E E " E && + test_commit -C space --author "F F " F && + test_commit -C space --author "G G " G && + test_commit -C space --author "H H " H && + + test_config -C space mailmap.file ../space.map && + cat >>space.map <<-\EOF && + Ah < a@example.com > + Bee < b@example.com > + Cee C + dee D + eee E E + eff F F + gee G G + aitch H H + EOF + + cat >expect <<-\EOF && + Author A maps to A + 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 Cee + Committer C O Mitter maps to C O Mitter + + Author D maps to dee + Committer C O Mitter maps to C O Mitter + + Author E E maps to eee + Committer C O Mitter maps to C O Mitter + + Author F F maps to eff + Committer C O Mitter maps to C O Mitter + + Author G G maps to gee + Committer C O Mitter maps to C O Mitter + + Author H H maps to H H + Committer C O Mitter maps to C O Mitter + EOF + git -C space 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