3 test_description='git am with corrupt input'
6 test_expect_success setup '
7 # Note the missing "+++" line:
8 cat >bad-patch.diff <<-\EOF &&
9 From: A U Thor <au.thor@example.com>
11 index 7898192..6178079 100644
24 # This used to fail before, too, but with a different diagnostic.
25 # fatal: unable to write file '(null)' mode 100644: Bad address
26 # Also, it had the unwanted side-effect of deleting f.
27 test_expect_success 'try to apply corrupted patch' '
28 test_must_fail git am bad-patch.diff 2>actual
31 test_expect_success 'compare diagnostic; ensure file is still here' '
32 echo "fatal: git diff header lacks filename information (line 4)" >expected &&
33 test_path_is_file f &&
34 test_cmp expected actual