submodule--helper: fix initialization of warn_if_uninitialized
[git.git] / t / t4123-apply-shrink.sh
blobdfa053ff28e8cbeb9ae311732871811777a8a18c
1 #!/bin/sh
3 test_description='apply a patch that is larger than the preimage'
6 TEST_PASSES_SANITIZE_LEAK=true
7 . ./test-lib.sh
9 cat >F <<\EOF
18 999999
30 EOF
32 test_expect_success setup '
34 git add F &&
35 mv F G &&
36 sed -e "s/1/11/" -e "s/999999/9/" -e "s/H/HH/" <G >F &&
37 git diff >patch &&
38 sed -e "/^\$/d" <G >F &&
39 git add F
43 test_expect_success 'apply should fail gracefully' '
45 if git apply --index patch
46 then
47 echo Oops, should not have succeeded
48 false
49 else
50 status=$? &&
51 echo "Status was $status" &&
52 if test -f .git/index.lock
53 then
54 echo Oops, should not have crashed
55 false
60 test_done