diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-07-15 02:54:06 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-07-15 08:16:00 -0700 |
commit | 8c3811510e2a90f765edbb6dc7f81b0737592c0a (patch) | |
tree | 1a77ecc81df37bf6d234df5795eebdbe841381b4 /t/t4203-mailmap.sh | |
parent | 109025b4e1c836fb62752f69f24e8f11403760d5 (diff) | |
download | git-8c3811510e2a90f765edbb6dc7f81b0737592c0a.tar.gz |
mailmap: do not lose single-letter names
In parse_name_and_email() function, there is this line:
*name = (nstart < nend ? nstart : NULL);
When the function is given a buffer "A <A@example.org> <old@x.z>",
nstart scans from the beginning of the buffer, skipping whitespaces
(there isn't any, so nstart points at the buffer), while nend starts
from one byte before the first '<' and skips whitespaces backwards
and stops at the first non-whitespace (i.e. it hits "A" at the
beginning of the buffer). nstart == nend in this case for a
single-letter name, and an off-by-one error makes it fail to pick up
the name, which makes the entry equivalent to
<A@example.org> <old@x.z>
without the name.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4203-mailmap.sh')
-rwxr-xr-x | t/t4203-mailmap.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index 27f8f86ea7..8583724375 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -247,7 +247,7 @@ test_expect_success 'cleanup after mailmap.blob tests' ' rm -f .mailmap ' -test_expect_failure 'single-character name' ' +test_expect_success 'single-character name' ' echo " 1 A <author@example.com>" >expect && echo " 1 nick1 <bugs@company.xx>" >>expect && echo "A <author@example.com>" >.mailmap && |