Merge branch 'jc/apply-ws-fix-expands-report'
authorJunio C Hamano <gitster@pobox.com>
Tue, 3 Mar 2015 22:37:02 +0000 (14:37 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 3 Mar 2015 22:37:02 +0000 (14:37 -0800)
"git apply --whitespace=fix" fixed whitespace errors in the common
context lines but did so without reporting.

* jc/apply-ws-fix-expands-report:
apply: detect and mark whitespace errors in context lines when fixing

builtin/apply.c
index 525db4a2a237fa0b12a254fd72b86dcd66738e93..65b97eee69d4814bf80f87b1fd6857b8ed80cb90 100644 (file)
@@ -1601,6 +1601,9 @@ static int parse_fragment(const char *line, unsigned long size,
                        if (!deleted && !added)
                                leading++;
                        trailing++;
+                       if (!apply_in_reverse &&
+                           ws_error_action == correct_ws_error)
+                               check_whitespace(line, len, patch->ws_rule);
                        break;
                case '-':
                        if (apply_in_reverse &&