summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-01-12 20:18:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-12 22:04:42 (GMT)
commit34986b773a0ebe0298965b64c801dd983cba29e6 (patch)
treeaa3b98d82d66cba196e4c089a8e9c0d91e348211 /t
parent9e2a14a88953da80cba75ddde4488a88402e7c8b (diff)
downloadgit-34986b773a0ebe0298965b64c801dd983cba29e6.zip
git-34986b773a0ebe0298965b64c801dd983cba29e6.tar.gz
git-34986b773a0ebe0298965b64c801dd983cba29e6.tar.bz2
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 <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4203-mailmap.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 4f61655..f19736f 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@example.com>" B &&
+ test_commit -C empty --author "C <c@example.com>" C &&
+
+ test_config -C empty mailmap.file ../empty.map &&
+ cat >>empty.map <<-\EOF &&
+ Ah <ah@example.com> <>
+ Bee <bee@example.com> <>
+ Cee <> <c@example.com>
+ EOF
+
+ cat >expect <<-\EOF &&
+ Author A <> maps to Bee <bee@example.com>
+ Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
+
+ Author B <b@example.com> maps to B <b@example.com>
+ Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
+
+ Author C <c@example.com> maps to C <c@example.com>
+ Committer C O Mitter <committer@example.com> maps to C O Mitter <committer@example.com>
+ 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