summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7dde4bb)
raw | patch | inline | side by side (parent: 7dde4bb)
author | Thomas Rast <trast@student.ethz.ch> | |
Fri, 4 Jul 2008 19:10:14 +0000 (21:10 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 5 Jul 2008 07:37:44 +0000 (00:37 -0700) |
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 <trast@student.ethz.ch>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 <trast@student.ethz.ch>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-apply.c | patch | blob | history | |
t/t4100-apply-stat.sh | patch | blob | history | |
t/t4100/t-apply-8.expect | [new file with mode: 0644] | patch | blob |
t/t4100/t-apply-8.patch | [new file with mode: 0644] | patch | blob |
t/t4100/t-apply-9.expect | [new file with mode: 0644] | patch | blob |
t/t4100/t-apply-9.patch | [new file with mode: 0644] | patch | blob |
diff --git a/builtin-apply.c b/builtin-apply.c
index 9fcfe3955dcd1aaca92a812b6253a331290922fa..c0f867daed351d4b32f871941e14773a44508eaf 100644 (file)
--- a/builtin-apply.c
+++ b/builtin-apply.c
newlines++;
continue;
case '\\':
- break;
+ continue;
case '@':
ret = size < 3 || prefixcmp(line, "@@ ");
break;
diff --git a/t/t4100-apply-stat.sh b/t/t4100-apply-stat.sh
index be837bb98ded356bfc10b3c371921b1b7bbb56bf..e0c67740a5ef85aaa3edc9a4514da72c92ce30ec 100755 (executable)
--- a/t/t4100-apply-stat.sh
+++ b/t/t4100-apply-stat.sh
non git (1)
non git (2)
non git (3)
+incomplete (1)
+incomplete (2)
EOF
test_done
diff --git a/t/t4100/t-apply-8.expect b/t/t4100/t-apply-8.expect
--- /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
--- /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
--- /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
--- /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