| # Copyright (c) 2006 Junio C Hamano |
| test_description='git apply with new style GNU diff with empty context |
| TEST_PASSES_SANITIZE_LEAK=true |
| test_expect_success setup ' |
| test_write_lines "" "" A B C "" >file1 && |
| sed -e "/^B/d" <file1.orig >file1 && |
| echo Q | tr -d "\\012" >>file2 && |
| sed -e "s/^ \$//" >diff.output |
| test_expect_success 'apply --numstat' ' |
| git apply --numstat diff.output >actual && |
| test_expect_success 'apply --apply' ' |
| git update-index file1 file2 && |
| git apply --index diff.output && |
| test_cmp file1.mods file1 && |
| test_cmp file2.mods file2 |