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