@matheusbsbs / matheus-bagliano / commits / c94bf41c9a
Fork 0

git-apply: what is detected and fixed is not just trailing spaces.

But we kept saying "trailing whitespace" all the same. Reword the error messages a bit. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Jun 2, 2007 at 19:55 UTC c94bf41c9a78dc1c084f2a2895f95b6b6d8f79b1
1 file changed +8 -9
builtin-apply.c
+8 -9
@@ -55,7 +55,7 @@ static enum whitespace_eol {
55 } new_whitespace = warn_on_whitespace;
56 static int whitespace_error;
57 static int squelch_whitespace_errors = 5;
58 -static int applied_after_stripping;
58 +static int applied_after_fixing_ws;
59 static const char *patch_input_file;
60
61 static void parse_whitespace_option(const char *option)
@@ -1657,7 +1657,7 @@ static int apply_line(char *output, const char *patch, int plen)
1657 if (add_nl_to_tail)
1658 output[plen++] = '\n';
1659 if (fixed)
1660 - applied_after_stripping++;
1660 + applied_after_fixing_ws++;
1661 return output + plen - buf;
1662 }
1663
@@ -2884,18 +2884,17 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)
2884 squelched == 1 ? "" : "s");
2885 }
2886 if (new_whitespace == error_on_whitespace)
2887 - die("%d line%s add%s trailing whitespaces.",
2887 + die("%d line%s add%s whitespace errors.",
2888 whitespace_error,
2889 whitespace_error == 1 ? "" : "s",
2890 whitespace_error == 1 ? "s" : "");
2891 - if (applied_after_stripping)
2891 + if (applied_after_fixing_ws)
2892 fprintf(stderr, "warning: %d line%s applied after"
2893 - " stripping trailing whitespaces.\n",
2894 - applied_after_stripping,
2895 - applied_after_stripping == 1 ? "" : "s");
2893 + " fixing whitespace errors.\n",
2894 + applied_after_fixing_ws,
2895 + applied_after_fixing_ws == 1 ? "" : "s");
2896 else if (whitespace_error)
2897 - fprintf(stderr, "warning: %d line%s add%s trailing"
2898 - " whitespaces.\n",
2897 + fprintf(stderr, "warning: %d line%s add%s whitespace errors.\n",
2898 whitespace_error,
2899 whitespace_error == 1 ? "" : "s",
2900 whitespace_error == 1 ? "s" : "");