Skip to content

Commit

Permalink
"git-apply --check" should not report "fixed"
Browse files Browse the repository at this point in the history
When running "git apply --check" while --whitespace=fix is
enabled (either from the command line or via the configuration),
we reported that "N line(s) applied after _fixing_", but --check
by itself does not apply and this message was alarming.

We could even reword the message to say "N line(s) would have
been applied after fixing...", but this patch does not go that
far.  Instead, we just make it use the "N lines add whitespace
errors" warning, which happens to be a good diagnostic message a
user would expect from the --check option.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Jan 9, 2008
1 parent e708af6 commit d8c3794
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -2907,7 +2907,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)
whitespace_error,
whitespace_error == 1 ? "" : "s",
whitespace_error == 1 ? "s" : "");
if (applied_after_fixing_ws)
if (applied_after_fixing_ws && apply)
fprintf(stderr, "warning: %d line%s applied after"
" fixing whitespace errors.\n",
applied_after_fixing_ws,
Expand Down

0 comments on commit d8c3794

Please sign in to comment.