]>
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 | ' | |
9 | . ./test-lib.sh | |
10 | ||
11 | # setup | |
12 | ||
13 | cat >test-patch <<\EOF | |
14 | diff --git a/file b/file | |
15 | --- a/file | |
16 | +++ b/file | |
17 | @@ -1,2 +1,3 @@ | |
18 | a | |
19 | b | |
20 | +c | |
21 | EOF | |
22 | ||
23 | echo 'a' >file | |
24 | echo 'b' >>file | |
25 | echo 'c' >>file | |
26 | ||
27 | test_expect_success setup \ | |
5be60078 | 28 | 'git update-index --add file' |
cc189c2c CM |
29 | |
30 | # test | |
31 | ||
41ac414e | 32 | test_expect_success 'apply at the end' \ |
d492b31c | 33 | 'test_must_fail git apply --index test-patch' |
cc189c2c | 34 | |
65aadb92 JH |
35 | cat >test-patch <<\EOF |
36 | diff a/file b/file | |
37 | --- a/file | |
38 | +++ b/file | |
39 | @@ -1,2 +1,3 @@ | |
40 | +a | |
41 | b | |
42 | c | |
43 | EOF | |
44 | ||
45 | echo >file 'a | |
46 | b | |
47 | c' | |
5be60078 | 48 | git update-index file |
65aadb92 | 49 | |
41ac414e | 50 | test_expect_success 'apply at the beginning' \ |
d492b31c | 51 | 'test_must_fail git apply --index test-patch' |
65aadb92 | 52 | |
cc189c2c | 53 | test_done |