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>
This commit is contained in:
parent
d3017e9373
commit
c94bf41c9a
@ -55,7 +55,7 @@ static enum whitespace_eol {
|
|||||||
} new_whitespace = warn_on_whitespace;
|
} new_whitespace = warn_on_whitespace;
|
||||||
static int whitespace_error;
|
static int whitespace_error;
|
||||||
static int squelch_whitespace_errors = 5;
|
static int squelch_whitespace_errors = 5;
|
||||||
static int applied_after_stripping;
|
static int applied_after_fixing_ws;
|
||||||
static const char *patch_input_file;
|
static const char *patch_input_file;
|
||||||
|
|
||||||
static void parse_whitespace_option(const char *option)
|
static void parse_whitespace_option(const char *option)
|
||||||
@ -1657,7 +1657,7 @@ static int apply_line(char *output, const char *patch, int plen)
|
|||||||
if (add_nl_to_tail)
|
if (add_nl_to_tail)
|
||||||
output[plen++] = '\n';
|
output[plen++] = '\n';
|
||||||
if (fixed)
|
if (fixed)
|
||||||
applied_after_stripping++;
|
applied_after_fixing_ws++;
|
||||||
return output + plen - buf;
|
return output + plen - buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2884,18 +2884,17 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)
|
|||||||
squelched == 1 ? "" : "s");
|
squelched == 1 ? "" : "s");
|
||||||
}
|
}
|
||||||
if (new_whitespace == error_on_whitespace)
|
if (new_whitespace == error_on_whitespace)
|
||||||
die("%d line%s add%s trailing whitespaces.",
|
die("%d line%s add%s whitespace errors.",
|
||||||
whitespace_error,
|
whitespace_error,
|
||||||
whitespace_error == 1 ? "" : "s",
|
whitespace_error == 1 ? "" : "s",
|
||||||
whitespace_error == 1 ? "s" : "");
|
whitespace_error == 1 ? "s" : "");
|
||||||
if (applied_after_stripping)
|
if (applied_after_fixing_ws)
|
||||||
fprintf(stderr, "warning: %d line%s applied after"
|
fprintf(stderr, "warning: %d line%s applied after"
|
||||||
" stripping trailing whitespaces.\n",
|
" fixing whitespace errors.\n",
|
||||||
applied_after_stripping,
|
applied_after_fixing_ws,
|
||||||
applied_after_stripping == 1 ? "" : "s");
|
applied_after_fixing_ws == 1 ? "" : "s");
|
||||||
else if (whitespace_error)
|
else if (whitespace_error)
|
||||||
fprintf(stderr, "warning: %d line%s add%s trailing"
|
fprintf(stderr, "warning: %d line%s add%s whitespace errors.\n",
|
||||||
" whitespaces.\n",
|
|
||||||
whitespace_error,
|
whitespace_error,
|
||||||
whitespace_error == 1 ? "" : "s",
|
whitespace_error == 1 ? "" : "s",
|
||||||
whitespace_error == 1 ? "s" : "");
|
whitespace_error == 1 ? "s" : "");
|
||||||
|
Loading…
Reference in New Issue
Block a user