]>
Commit | Line | Data |
---|---|---|
cc189c2c CM |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2006 Catalin Marinas | |
4 | # | |
5 | ||
5be60078 | 6 | test_description='git apply trying to add an ending line. |
cc189c2c CM |
7 | |
8 | ' | |
71c79160 | 9 | TEST_PASSES_SANITIZE_LEAK=true |
cc189c2c CM |
10 | . ./test-lib.sh |
11 | ||
12 | # setup | |
13 | ||
14 | cat >test-patch <<\EOF | |
15 | diff --git a/file b/file | |
16 | --- a/file | |
17 | +++ b/file | |
18 | @@ -1,2 +1,3 @@ | |
19 | a | |
20 | b | |
21 | +c | |
22 | EOF | |
23 | ||
24 | echo 'a' >file | |
25 | echo 'b' >>file | |
26 | echo 'c' >>file | |
27 | ||
28 | test_expect_success setup \ | |
5be60078 | 29 | 'git update-index --add file' |
cc189c2c CM |
30 | |
31 | # test | |
32 | ||
41ac414e | 33 | test_expect_success 'apply at the end' \ |
d492b31c | 34 | 'test_must_fail git apply --index test-patch' |
cc189c2c | 35 | |
65aadb92 JH |
36 | cat >test-patch <<\EOF |
37 | diff a/file b/file | |
38 | --- a/file | |
39 | +++ b/file | |
40 | @@ -1,2 +1,3 @@ | |
41 | +a | |
42 | b | |
43 | c | |
44 | EOF | |
45 | ||
46 | echo >file 'a | |
47 | b | |
48 | c' | |
5be60078 | 49 | git update-index file |
65aadb92 | 50 | |
41ac414e | 51 | test_expect_success 'apply at the beginning' \ |
d492b31c | 52 | 'test_must_fail git apply --index test-patch' |
65aadb92 | 53 | |
cc189c2c | 54 | test_done |