Merge branch 'jk/execv-dashed-external'
[git/raj.git] / t / t4136-apply-check.sh
blob4b0a374b63f4128405c88fdb2410fb679bdd06a1
1 #!/bin/sh
3 test_description='git apply should exit non-zero with unrecognized input.'
5 . ./test-lib.sh
7 test_expect_success 'setup' '
8 test_commit 1
11 test_expect_success 'apply --check exits non-zero with unrecognized input' '
12 test_must_fail git apply --check - <<-\EOF
13 I am not a patch
14 I look nothing like a patch
15 git apply must fail
16 EOF
19 test_expect_success 'apply exits non-zero with no-op patch' '
20 cat >input <<-\EOF &&
21 diff --get a/1 b/1
22 index 6696ea4..606eddd 100644
23 --- a/1
24 +++ b/1
25 @@ -1,1 +1,1 @@
27 EOF
28 test_must_fail git apply --stat input &&
29 test_must_fail git apply --check input
32 test_done