Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 <>
Signed-off-by: Junio C Hamano <>
  • Loading branch information...
commit 948065a4837f006c5c84ee1288cf15f1a56d93f2 1 parent b1f5b78
@jrn jrn authored gitster committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  t/
2  t/
@@ -525,7 +525,7 @@ test_expect_success 'am empty-file does not infloop' '
git reset --hard &&
touch empty-file &&
test_tick &&
- { git am empty-file > actual 2>&1 && false || :; } &&
+ test_must_fail git am empty-file 2>actual &&
echo Patch format detection failed. >expected &&
test_i18ncmp expected actual
Please sign in to comment.
Something went wrong with that request. Please try again.