Merge branch 'ap/commit-author-mailmap' into maint
authorJunio C Hamano <gitster@pobox.com>
Thu, 17 Oct 2013 22:45:51 +0000 (15:45 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Oct 2013 22:45:52 +0000 (15:45 -0700)
* ap/commit-author-mailmap:
commit: search author pattern against mailmap

1  2 
t/t4203-mailmap.sh
diff --combined t/t4203-mailmap.sh
index ce3eace065be81612e1ab2f994909b9352d5a06c,4d715f058c5fba2741eda4e193f096570647f63c..0dd8b65d7cdec2ada739d7e0b524fd3c66dd5ef4
@@@ -202,8 -202,7 +202,8 @@@ test_expect_success 'setup mailmap blo
        Blob Guy <author@example.com>
        Blob Guy <bugs@company.xx>
        EOF
 -      git add just-bugs both &&
 +      printf "Tricky Guy <author@example.com>" >no-newline &&
 +      git add just-bugs both no-newline &&
        git commit -m "my mailmaps" &&
        echo "Repo Guy <author@example.com>" >.mailmap &&
        echo "Internal Guy <author@example.com>" >internal.map
@@@ -287,19 -286,6 +287,19 @@@ test_expect_success 'mailmap.blob defau
        )
  '
  
 +test_expect_success 'mailmap.blob can handle blobs without trailing newline' '
 +      cat >expect <<-\EOF &&
 +      Tricky Guy (1):
 +            initial
 +
 +      nick1 (1):
 +            second
 +
 +      EOF
 +      git -c mailmap.blob=map:no-newline shortlog HEAD >actual &&
 +      test_cmp expect actual
 +'
 +
  test_expect_success 'cleanup after mailmap.blob tests' '
        rm -f .mailmap
  '
@@@ -484,4 -470,15 +484,15 @@@ test_expect_success 'Blame output (comp
        test_cmp expect actual.fuzz
  '
  
+ cat >expect <<\EOF
+ Some Dude <some@dude.xx>
+ 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