debian: new upstream point release
[git/debian.git] / t / t4113-apply-ending.sh
blob2c65c6a16960a0429764ac628aab001fd14ed2f3
1 #!/bin/sh
3 # Copyright (c) 2006 Catalin Marinas
6 test_description='git apply trying to add an ending line.
9 TEST_PASSES_SANITIZE_LEAK=true
10 . ./test-lib.sh
12 # setup
14 cat >test-patch <<\EOF
15 diff --git a/file b/file
16 --- a/file
17 +++ b/file
18 @@ -1,2 +1,3 @@
22 EOF
24 echo 'a' >file
25 echo 'b' >>file
26 echo 'c' >>file
28 test_expect_success setup \
29 'git update-index --add file'
31 # test
33 test_expect_success 'apply at the end' \
34 'test_must_fail git apply --index test-patch'
36 cat >test-patch <<\EOF
37 diff a/file b/file
38 --- a/file
39 +++ b/file
40 @@ -1,2 +1,3 @@
44 EOF
46 echo >file 'a
49 git update-index file
51 test_expect_success 'apply at the beginning' \
52 'test_must_fail git apply --index test-patch'
54 test_done