mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'jk/check-mailmap-wo-name-fix'
"git check-mailmap" segfault fix. * jk/check-mailmap-wo-name-fix: mailmap: fix check-mailmap with full mailmap line
This commit is contained in:
@@ -35,7 +35,7 @@ static void check_mailmap(struct string_list *mailmap, const char *contact)
|
|||||||
mail = ident.mail_begin;
|
mail = ident.mail_begin;
|
||||||
maillen = ident.mail_end - ident.mail_begin;
|
maillen = ident.mail_end - ident.mail_begin;
|
||||||
} else {
|
} else {
|
||||||
name = NULL;
|
name = "";
|
||||||
namelen = 0;
|
namelen = 0;
|
||||||
mail = contact;
|
mail = contact;
|
||||||
maillen = strlen(contact);
|
maillen = strlen(contact);
|
||||||
|
|||||||
@@ -113,6 +113,18 @@ test_expect_success 'check-mailmap --stdin simple address: no mapping' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'check-mailmap name and address: mapping' '
|
||||||
|
test_when_finished "rm .mailmap" &&
|
||||||
|
cat >.mailmap <<-EOF &&
|
||||||
|
Bug Reports <bugs-new@company.xx> Bugs <bugs@company.xx>
|
||||||
|
EOF
|
||||||
|
cat >expect <<-EOF &&
|
||||||
|
<bugs@company.xx>
|
||||||
|
EOF
|
||||||
|
git check-mailmap "bugs@company.xx" >actual &&
|
||||||
|
test_cmp expect actual
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'No mailmap' '
|
test_expect_success 'No mailmap' '
|
||||||
cat >expect <<-EOF &&
|
cat >expect <<-EOF &&
|
||||||
$GIT_AUTHOR_NAME (1):
|
$GIT_AUTHOR_NAME (1):
|
||||||
|
|||||||
Reference in New Issue
Block a user