@matheusbsbs / matheus-bagliano / commits / cc189c2ca2
Fork 0

Add a test-case for git-apply trying to add an ending line

git-apply adding an ending line doesn't seem to fail if the ending line is already present in the patched file. Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Catalin Marinas committed May 23, 2006 at 22:48 UTC cc189c2ca2c725c430f100f61e7c4a6849f93163
1 file changed +35
t/t4113-apply-ending.sh new
+35
@@ -0,0 +1,35 @@
1 +#!/bin/sh
2 +#
3 +# Copyright (c) 2006 Catalin Marinas
4 +#
5 +
6 +test_description='git-apply trying to add an ending line.
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 \
28 + 'git-update-index --add file'
29 +
30 +# test
31 +
32 +test_expect_failure apply \
33 + 'git-apply --index test-patch'
34 +
35 +test_done