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