From ea16794e4303e79f8acb01a93fb6b1762972ab86 Mon Sep 17 00:00:00 2001 From: Antoine Pelisse Date: Fri, 23 Aug 2013 15:48:31 +0200 Subject: commit: search author pattern against mailmap "git commit --author=$name" sets the author to one whose name matches the given string from existing commits, when $name is not in the "Name " format. However, it does not honor the mailmap to use the canonical name for the author found this way. Fix it by telling the logic to find a matching existing author to honor the mailmap, and use the name and email after applying the mailmap. Signed-off-by: Antoine Pelisse Signed-off-by: Junio C Hamano --- t/t4203-mailmap.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 't') diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh index baa4685dcc..4d715f058c 100755 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@ -470,4 +470,15 @@ test_expect_success 'Blame output (complex mapping)' ' test_cmp expect actual.fuzz ' +cat >expect <<\EOF +Some Dude +EOF + +test_expect_success 'commit --author honors mailmap' ' + test_must_fail git commit --author "nick" --allow-empty -meight && + git commit --author "Some Dude" --allow-empty -meight && + git show --pretty=format:"%an <%ae>%n" >actual && + test_cmp expect actual +' + test_done -- cgit v1.2.3