interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t4123-apply-shrink.sh

46 lines · 478 bytes Raw Blame History
1#!/bin/sh
2
3test_description='apply a patch that is larger than the preimage'
4
5. ./test-lib.sh
6
7cat >F <<\EOF
81
92
103
114
125
136
147
158
16999999
17A
18B
19C
20D
21E
22F
23G
24H
25I
26J
27
28EOF
29
30test_expect_success setup '
31
32 git add F &&
33 mv F G &&
34 sed -e "s/1/11/" -e "s/999999/9/" -e "s/H/HH/" <G >F &&
35 git diff >patch &&
36 sed -e "/^\$/d" <G >F &&
37 git add F
38
39'
40
41test_expect_success 'apply should fail gracefully' '
42 test_must_fail git apply --index patch &&
43 test_path_is_missing .git/index.lock
44'
45
46test_done