Skip to content

Commit 56ac194

Browse files
avargitster
authored andcommitted
mailmap: test for silent exiting on missing file/blob
That we silently ignore missing mailmap.file or mailmap.blob values is intentional. See 938a60d (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c1fe7fd commit 56ac194

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

t/t4203-mailmap.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,24 @@ test_expect_success 'mailmap.file overrides mailmap.blob' '
309309
test_cmp expect actual
310310
'
311311

312+
test_expect_success 'mailmap.file can be missing' '
313+
test_when_finished "rm .mailmap" &&
314+
cp default.map .mailmap &&
315+
316+
test_config mailmap.file nonexistent &&
317+
cat >expect <<-\EOF &&
318+
Repo Guy (1):
319+
initial
320+
321+
nick1 (1):
322+
second
323+
324+
EOF
325+
git shortlog HEAD >actual 2>err &&
326+
test_must_be_empty err &&
327+
test_cmp expect actual
328+
'
329+
312330
test_expect_success 'mailmap.blob can be missing' '
313331
test_when_finished "rm .mailmap" &&
314332
cp default.map .mailmap &&
@@ -321,7 +339,8 @@ test_expect_success 'mailmap.blob can be missing' '
321339
second
322340
323341
EOF
324-
git -c mailmap.blob=map:nonexistent shortlog HEAD >actual &&
342+
git -c mailmap.blob=map:nonexistent shortlog HEAD >actual 2>err &&
343+
test_must_be_empty err &&
325344
test_cmp expect actual
326345
'
327346

0 commit comments

Comments
 (0)