[PATCH 2/2] test: check that "git blame -e" uses mailmap correctly
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Feb 14, 2012, 20:36 UTC
- Message-ID
- <20120214203603.GD13210@burratino>
- In-Reply-To
- <20120214203431.GB13210@burratino>
From: Felipe Contreras <felipe.contreras@gmail.com>
Until f026358e ("mailmap: always return a plain mail address from map_user()", 2012-02-05), git blame -e would add a spurious '>' after the unchanged email address with brackets it passed to the mailmap machinery, resulting in lines with a doubled '>' like this:
620456e6 (<committer@example.com>> 2005-04-07 15:20:13 -0700 8) eight
Add a test to make sure it doesn't happen again. This reuses the test data for the existing "shortlog -e" test so it also tests other kinds of mail mapping.
[jn: fixed some cut+paste cruft, added a patch description]
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> --- t/t4203-mailmap.sh | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index 45526395..ef900d84 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -267,4 +267,20 @@ test_expect_success 'Blame output (complex mapping)' ' test_cmp expect actual.fuzz ' +cat >expect <<\EOF +^OBJI (<author@example.com> DATE 1) one +OBJID (<some@dude.xx> DATE 2) two +OBJID (<other@author.xx> DATE 3) three +OBJID (<other@author.xx> DATE 4) four +OBJID (<santa.claus@northpole.xx> DATE 5) five +OBJID (<santa.claus@northpole.xx> DATE 6) six +OBJID (<cto@company.xx> DATE 7) seven +OBJID (<committer@example.com> DATE 8) eight +EOF +test_expect_success 'Blame -e output' ' + git blame -e one >actual && + fuzz_blame actual >actual.fuzz && + test_cmp expect actual.fuzz +' + test_done
-- 1.7.9