]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t4203: demonstrate loss of single-character name in mailmap entry
authorEric Sunshine <sunshine@sunshineco.com>
Mon, 15 Jul 2013 06:54:05 +0000 (02:54 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 Jul 2013 15:09:04 +0000 (08:09 -0700)
A bug in mailmap.c:parse_name_and_email() causes it to overlook the
single-character name in "A <user@host>" and parse it only as
"<user@host>". Demonstrate this problem.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4203-mailmap.sh

index 842b7549ec3ed6b1fa268a96d085048d2f0b7793..27f8f86ea759b52b69b78c6a16a151f0e57cb6ec 100755 (executable)
@@ -247,6 +247,15 @@ test_expect_success 'cleanup after mailmap.blob tests' '
        rm -f .mailmap
 '
 
+test_expect_failure 'single-character name' '
+       echo "     1    A <author@example.com>" >expect &&
+       echo "     1    nick1 <bugs@company.xx>" >>expect &&
+       echo "A <author@example.com>" >.mailmap &&
+       test_when_finished "rm .mailmap" &&
+       git shortlog -es HEAD >actual &&
+       test_cmp expect actual
+'
+
 # Extended mailmap configurations should give us the following output for shortlog
 cat >expect <<\EOF
 A U Thor <author@example.com> (1):