aboutsummaryrefslogtreecommitdiff
path: root/t/t4203-mailmap.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-07-22 11:24:14 -0700
committerJunio C Hamano <gitster@pobox.com>2013-07-22 11:24:14 -0700
commite683889b75a32b8c2bf11c8fa0cf851087bc5415 (patch)
tree60f3aa50981c9dc2888fb734df1103d40342d3a1 /t/t4203-mailmap.sh
parent988f98f61fc80021311c2d161084c03a55f7354d (diff)
parentcb5c9521f1e41aa536c2cf64d689e647d035bb90 (diff)
downloadgit-e683889b75a32b8c2bf11c8fa0cf851087bc5415.tar.gz
git-e683889b75a32b8c2bf11c8fa0cf851087bc5415.tar.xz
Merge branch 'es/check-mailmap'
A new command to allow scripts to query the mailmap information. * es/check-mailmap: t4203: test check-mailmap command invocation builtin: add git-check-mailmap command
Diffstat (limited to 't/t4203-mailmap.sh')
-rwxr-xr-xt/t4203-mailmap.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index c32df80f1..baa4685dc 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -13,6 +13,11 @@ fuzz_blame () {
}
test_expect_success setup '
+ cat >contacts <<-\EOF &&
+ A U Thor <author@example.com>
+ nick1 <bugs@company.xx>
+ EOF
+
echo one >one &&
git add one &&
test_tick &&
@@ -23,6 +28,44 @@ test_expect_success setup '
git commit --author "nick1 <bugs@company.xx>" -m second
'
+test_expect_success 'check-mailmap no arguments' '
+ test_must_fail git check-mailmap
+'
+
+test_expect_success 'check-mailmap arguments' '
+ cat >expect <<-\EOF &&
+ A U Thor <author@example.com>
+ nick1 <bugs@company.xx>
+ EOF
+ git check-mailmap \
+ "A U Thor <author@example.com>" \
+ "nick1 <bugs@company.xx>" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'check-mailmap --stdin' '
+ cat >expect <<-\EOF &&
+ A U Thor <author@example.com>
+ nick1 <bugs@company.xx>
+ EOF
+ git check-mailmap --stdin <contacts >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'check-mailmap --stdin arguments' '
+ cat >expect <<-\EOF &&
+ Internal Guy <bugs@company.xy>
+ EOF
+ cat <contacts >>expect &&
+ git check-mailmap --stdin "Internal Guy <bugs@company.xy>" \
+ <contacts >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'check-mailmap bogus contact' '
+ test_must_fail git check-mailmap bogus
+'
+
cat >expect <<\EOF
A U Thor (1):
initial