]> git.ipfire.org Git - thirdparty/git.git/blob - t/t4123-apply-shrink.sh
The second batch
[thirdparty/git.git] / t / t4123-apply-shrink.sh
1 #!/bin/sh
2
3 test_description='apply a patch that is larger than the preimage'
4
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 cat >F <<\EOF
9 1
10 2
11 3
12 4
13 5
14 6
15 7
16 8
17 999999
18 A
19 B
20 C
21 D
22 E
23 F
24 G
25 H
26 I
27 J
28
29 EOF
30
31 test_expect_success setup '
32
33 git add F &&
34 mv F G &&
35 sed -e "s/1/11/" -e "s/999999/9/" -e "s/H/HH/" <G >F &&
36 git diff >patch &&
37 sed -e "/^\$/d" <G >F &&
38 git add F
39
40 '
41
42 test_expect_success 'apply should fail gracefully' '
43 test_must_fail git apply --index patch &&
44 test_path_is_missing .git/index.lock
45 '
46
47 test_done