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

"git-apply --check" should not report "fixed"

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>

Junio C Hamano committed Jan 8, 2008 at 15:46 UTC d8c3794503553c22330f46ed4c0e70a6613d2f65
1 file changed +1 -1
builtin-apply.c
+1 -1
@@ -2907,7 +2907,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)
2907 whitespace_error,
2908 whitespace_error == 1 ? "" : "s",
2909 whitespace_error == 1 ? "s" : "");
2910 - if (applied_after_fixing_ws)
2910 + if (applied_after_fixing_ws && apply)
2911 fprintf(stderr, "warning: %d line%s applied after"
2912 " fixing whitespace errors.\n",
2913 applied_after_fixing_ws,