| test_description='git apply should exit non-zero with unrecognized input.' |
| TEST_PASSES_SANITIZE_LEAK=true |
| test_expect_success 'setup' ' |
| test_expect_success 'apply --check exits non-zero with unrecognized input' ' |
| test_must_fail git apply --check - <<-\EOF |
| I look nothing like a patch |
| test_expect_success 'apply exits non-zero with no-op patch' ' |
| index 6696ea4..606eddd 100644 |
| test_must_fail git apply --stat input && |
| test_must_fail git apply --check input |
| test_expect_success '`apply --recount` allows no-op patch' ' |
| git apply --recount --check <<-\EOF |
| index 6696ea4..606eddd 100644 |
| test_expect_success 'invalid combination: create and copy' ' |
| test_must_fail git apply --check - <<-\EOF |
| test_expect_success 'invalid combination: create and rename' ' |
| test_must_fail git apply --check - <<-\EOF |