git-p4: When skipping a patch as part of "git-p4 submit" make sure we correctly rever...
[alt-git.git] / t / t4113-apply-ending.sh
blob1c6bec044a00faf24e275280e0b9fa667356f2b3
1 #!/bin/sh
3 # Copyright (c) 2006 Catalin Marinas
6 test_description='git apply trying to add an ending line.
9 . ./test-lib.sh
11 # setup
13 cat >test-patch <<\EOF
14 diff --git a/file b/file
15 --- a/file
16 +++ b/file
17 @@ -1,2 +1,3 @@
21 EOF
23 echo 'a' >file
24 echo 'b' >>file
25 echo 'c' >>file
27 test_expect_success setup \
28 'git update-index --add file'
30 # test
32 test_expect_failure 'apply at the end' \
33 'git apply --index test-patch'
35 cat >test-patch <<\EOF
36 diff a/file b/file
37 --- a/file
38 +++ b/file
39 @@ -1,2 +1,3 @@
43 EOF
45 echo >file 'a
48 git update-index file
50 test_expect_failure 'apply at the beginning' \
51 'git apply --index test-patch'
53 test_done