From: Jonathan Nieder Date: Mon, 11 Oct 2010 16:21:53 GMT Subject: Re: [PATCH next] don't let mailmap provoke use of freed memory Message-ID: <20101011162153.GG25842@burratino> In-Reply-To: <87tyksd9er.fsf@meyering.net> Jim Meyering wrote: > Signed-off-by: Jim Meyering Applies to maint, too --- confirmed with the tests below (both fail before, pass after). Thanks. Signed-off-by: Jonathan Nieder --- 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 " > 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 " " >internal_mailmap/.mailmap && + echo "Internal Guy " >>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 " " >internal_mailmap/.mailmap && + echo "Internal Guy " >>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 " -m seventh && - mkdir internal_mailmap && + mkdir -p internal_mailmap && echo "Committed " > internal_mailmap/.mailmap && echo " " >> internal_mailmap/.mailmap && echo "Some Dude nick1 " >> internal_mailmap/.mailmap && -- 1.7.2.3