From 6cf91492d9cd985e1fa65181d99d6d578d4439dc Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Fri, 4 Jul 2008 21:10:14 +0200 Subject: Fix apply --recount handling of no-EOL line If a patch modifies the last line of a file that previously had no terminating '\n', it looks like -old text \ No newline at end of file +new text Hence, a '\' line does not signal the end of the hunk. This modifies 'git apply --recount' to take this into account. Signed-off-by: Thomas Rast Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/t4100/t-apply-8.expect | 2 ++ t/t4100/t-apply-8.patch | 11 +++++++++++ t/t4100/t-apply-9.expect | 2 ++ t/t4100/t-apply-9.patch | 11 +++++++++++ 4 files changed, 26 insertions(+) create mode 100644 t/t4100/t-apply-8.expect create mode 100644 t/t4100/t-apply-8.patch create mode 100644 t/t4100/t-apply-9.expect create mode 100644 t/t4100/t-apply-9.patch (limited to 't/t4100') diff --git a/t/t4100/t-apply-8.expect b/t/t4100/t-apply-8.expect new file mode 100644 index 0000000000..eef7f2e65c --- /dev/null +++ b/t/t4100/t-apply-8.expect @@ -0,0 +1,2 @@ + t/t4100-apply-stat.sh | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/t/t4100/t-apply-8.patch b/t/t4100/t-apply-8.patch new file mode 100644 index 0000000000..5ca13e6594 --- /dev/null +++ b/t/t4100/t-apply-8.patch @@ -0,0 +1,11 @@ +diff --git a/t/t4100-apply-stat.sh b/t/t4100-apply-stat.sh +index be837bb..0798c64 100755 +--- a/t/t4100-apply-stat.sh ++++ b/t/t4100-apply-stat.sh +@@ -35,4 +35,4 @@ non git (2) + non git (3) + EOF + +-test_done ++test_done +\ No newline at end of file diff --git a/t/t4100/t-apply-9.expect b/t/t4100/t-apply-9.expect new file mode 100644 index 0000000000..eef7f2e65c --- /dev/null +++ b/t/t4100/t-apply-9.expect @@ -0,0 +1,2 @@ + t/t4100-apply-stat.sh | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/t/t4100/t-apply-9.patch b/t/t4100/t-apply-9.patch new file mode 100644 index 0000000000..875d57d567 --- /dev/null +++ b/t/t4100/t-apply-9.patch @@ -0,0 +1,11 @@ +diff --git a/t/t4100-apply-stat.sh b/t/t4100-apply-stat.sh +index 0798c64..be837bb 100755 +--- a/t/t4100-apply-stat.sh ++++ b/t/t4100-apply-stat.sh +@@ -35,4 +35,4 @@ non git (2) + non git (3) + EOF + +-test_done +\ No newline at end of file ++test_done -- cgit v1.2.3