summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-01-12 20:17:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-12 22:04:41 (GMT)
commit56ac194e1d3b3f3b46c2d48f47bde69d35547a7c (patch)
tree2c844bf416c18fa05ade410d4cdf12b7b9ea6d6b /t
parentc1fe7fd7e343517f743c3dc0d905f9f3083f66e7 (diff)
downloadgit-56ac194e1d3b3f3b46c2d48f47bde69d35547a7c.zip
git-56ac194e1d3b3f3b46c2d48f47bde69d35547a7c.tar.gz
git-56ac194e1d3b3f3b46c2d48f47bde69d35547a7c.tar.bz2
mailmap: test for silent exiting on missing file/blob
That we silently ignore missing mailmap.file or mailmap.blob values is intentional. See 938a60d64f (mailmap: clean up read_mailmap error handling, 2012-12-12). However, nothing tested for this. Let's do that by checking that stderr is empty in those cases. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4203-mailmap.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
index a42b454..2b342d7 100755
--- a/t/t4203-mailmap.sh
+++ b/t/t4203-mailmap.sh
@@ -309,6 +309,24 @@ test_expect_success 'mailmap.file overrides mailmap.blob' '
test_cmp expect actual
'
+test_expect_success 'mailmap.file can be missing' '
+ test_when_finished "rm .mailmap" &&
+ cp default.map .mailmap &&
+
+ test_config mailmap.file nonexistent &&
+ cat >expect <<-\EOF &&
+ Repo Guy (1):
+ initial
+
+ nick1 (1):
+ second
+
+ EOF
+ git shortlog HEAD >actual 2>err &&
+ test_must_be_empty err &&
+ test_cmp expect actual
+'
+
test_expect_success 'mailmap.blob can be missing' '
test_when_finished "rm .mailmap" &&
cp default.map .mailmap &&
@@ -321,7 +339,8 @@ test_expect_success 'mailmap.blob can be missing' '
second
EOF
- git -c mailmap.blob=map:nonexistent shortlog HEAD >actual &&
+ git -c mailmap.blob=map:nonexistent shortlog HEAD >actual 2>err &&
+ test_must_be_empty err &&
test_cmp expect actual
'