Re: [PATCH next] don't let mailmap provoke use of freed memory
From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:45
Subsystem:
the rest · Maintainer:
Linus Torvalds
Jim Meyering wrote:
Signed-off-by: Jim Meyering <redacted>
Applies to maint, too --- confirmed with the tests below (both fail before, pass after). Thanks. Signed-off-by: Jonathan Nieder <redacted> --- t/t4203-mailmap.sh | 40 +++++++++++++++++++++++++++++++++++++--- 1 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index 9a7d1b4..3c5188f 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh@@ -54,7 +54,7 @@ Repo Guy (1): EOF test_expect_success 'mailmap.file set' ' - mkdir internal_mailmap && + mkdir -p internal_mailmap && echo "Internal Guy <bugs@company.xx>" > internal_mailmap/.mailmap && git config mailmap.file internal_mailmap/.mailmap && git shortlog HEAD >actual &&
@@ -93,6 +93,40 @@ test_expect_success 'mailmap.file non-existant' ' ' cat >expect <<\EOF +Internal Guy (1): + second + +Repo Guy (1): + initial + +EOF + +test_expect_success 'name entry after email entry' ' + mkdir -p internal_mailmap && + echo "<bugs@company.xy> <bugs@company.xx>" >internal_mailmap/.mailmap && + echo "Internal Guy <bugs@company.xx>" >>internal_mailmap/.mailmap && + git shortlog >actual && + test_cmp expect actual +' + +cat >expect <<\EOF +Internal Guy (1): + second + +Repo Guy (1): + initial + +EOF + +test_expect_success 'name entry after email entry, case-insensitive' ' + mkdir -p internal_mailmap && + echo "<bugs@company.xy> <bugs@company.xx>" >internal_mailmap/.mailmap && + echo "Internal Guy <BUGS@Company.xx>" >>internal_mailmap/.mailmap && + git shortlog >actual && + test_cmp expect actual +' + +cat >expect <<\EOF A U Thor (1): initial
@@ -101,7 +135,7 @@ nick1 (1): EOF test_expect_success 'No mailmap files, but configured' ' - rm .mailmap && + rm -f .mailmap internal_mailmap/.mailmap && git shortlog HEAD >actual && test_cmp expect actual '
@@ -153,7 +187,7 @@ test_expect_success 'Shortlog output (complex mapping)' ' test_tick && git commit --author "CTO <cto@coompany.xx>" -m seventh && - mkdir internal_mailmap && + mkdir -p internal_mailmap && echo "Committed <committer@example.com>" > internal_mailmap/.mailmap && echo "<cto@company.xx> <cto@coompany.xx>" >> internal_mailmap/.mailmap && echo "Some Dude <some@dude.xx> nick1 <bugs@company.xx>" >> internal_mailmap/.mailmap &&
--
1.7.2.3