git-apply: do not fix whitespaces on context lines.
Internal function apply_line() is called to copy both context lines and added lines to the output buffer, while possibly fixing the whitespace breakages depending on --whitespace=strip settings. However, it did its fix-up on both context lines and added lines. This resulted in two symptoms: (1) The number of lines reported to have been fixed up included these context lines. (2) However, the lines actually shown were limited to the added lines that had whitespace breakages. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Feb 27, 2007 at 01:31 UTC
63e50d492c658b4a0d616f57f8b43a7a9ba1bbcc
1 file changed
+2
-1
builtin-apply.c
+2
-1
@@ -1539,7 +1539,8 @@ static int apply_line(char *output, const char *patch, int plen)
1539
int need_fix_leading_space = 0;
1540
char *buf;
1541
1542
- if ((new_whitespace != strip_whitespace) || !whitespace_error) {
1542
+ if ((new_whitespace != strip_whitespace) || !whitespace_error ||
1543
+ *patch != '+') {
1544
memcpy(output, patch + 1, plen);
1545
return plen;
1546
}