{"thread":{"id":"6986","subject":"[PATCH] git-apply: do not fix whitespaces on context lines.","startedAt":"2007-02-27T09:33:33Z","lastAt":"2007-02-27T09:33:33Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"35582","messageId":"7vzm70hrma.fsf@assigned-by-dhcp.cox.net","threadId":"6986","inReplyTo":null,"subject":"[PATCH] git-apply: do not fix whitespaces on context lines.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-27T09:33:33Z","receivedAt":"2007-02-27T09:33:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Internal function apply_line() is called to copy both context lines\nand added lines to the output buffer, while possibly fixing the\nwhitespace breakages depending on --whitespace=strip settings.\nHowever, it did its fix-up on both context lines and added lines.\n\nThis resulted in two symptoms:\n\n (1) The number of lines reported to have been fixed up included\n     these context lines.\n\n (2) However, the lines actually shown were limited to the added\n     lines that had whitespace breakages.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n builtin-apply.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-apply.c b/builtin-apply.c\nindex abe3538..bec95d6 100644\n--- a/builtin-apply.c\n+++ b/builtin-apply.c\n@@ -1539,7 +1539,8 @@ static int apply_line(char *output, const char *patch, int plen)\n \tint need_fix_leading_space = 0;\n \tchar *buf;\n \n-\tif ((new_whitespace != strip_whitespace) || !whitespace_error) {\n+\tif ((new_whitespace != strip_whitespace) || !whitespace_error ||\n+\t    *patch != '+') {\n \t\tmemcpy(output, patch + 1, plen);\n \t\treturn plen;\n \t}\n-- \n1.5.0.2.775.g1a500\n"}]}