aboutsummaryrefslogtreecommitdiff
path: root/builtin-apply.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-07-07 18:50:39 +0100
committerJunio C Hamano <gitster@pobox.com>2007-07-07 11:54:51 -0700
commit5fda48d67c82e07950e0b0c21cd8c97daefd7be0 (patch)
tree6e00623936013d4aaea619c55cd0d7c45fa96257 /builtin-apply.c
parented5f07a6fdc5653e24a5bd6c216d12bc878496bd (diff)
downloadgit-5fda48d67c82e07950e0b0c21cd8c97daefd7be0.tar.gz
git-5fda48d67c82e07950e0b0c21cd8c97daefd7be0.tar.xz
Fix "apply --reverse" with regard to whitespace
"git apply" used to take check the whitespace in the wrong direction. Noticed by Daniel Barkalow. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-apply.c')
-rw-r--r--builtin-apply.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin-apply.c b/builtin-apply.c
index 0399743c4..490e23ef4 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -1003,12 +1003,16 @@ static int parse_fragment(char *line, unsigned long size, struct patch *patch, s
trailing++;
break;
case '-':
+ if (apply_in_reverse &&
+ new_whitespace != nowarn_whitespace)
+ check_whitespace(line, len);
deleted++;
oldlines--;
trailing = 0;
break;
case '+':
- if (new_whitespace != nowarn_whitespace)
+ if (!apply_in_reverse &&
+ new_whitespace != nowarn_whitespace)
check_whitespace(line, len);
added++;
newlines--;