From 5fda48d67c82e07950e0b0c21cd8c97daefd7be0 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 7 Jul 2007 18:50:39 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- builtin-apply.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'builtin-apply.c') diff --git a/builtin-apply.c b/builtin-apply.c index 0399743c4e..490e23ef40 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--; -- cgit v1.2.1