Skip to content

Commit 948065a

Browse files
jrngitster
authored andcommitted
test: am of empty patch should not succeed
The "git am empty" test uses the construct git am empty-file && false || : which unconditionally returns true. Use test_must_fail instead, which also has the benefit of noticing if "git am" has segfaulted. While at it, tighten the test to check that the diagnostic appears on stderr and not stdout. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent b1f5b78 commit 948065a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t4150-am.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ test_expect_success 'am empty-file does not infloop' '
525525
git reset --hard &&
526526
touch empty-file &&
527527
test_tick &&
528-
{ git am empty-file > actual 2>&1 && false || :; } &&
528+
test_must_fail git am empty-file 2>actual &&
529529
echo Patch format detection failed. >expected &&
530530
test_i18ncmp expected actual
531531
'

0 commit comments

Comments
 (0)