[PATCH 1/2] "git-apply --check" should not report "fixed"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 builtin-apply.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-apply.c b/builtin-apply.c
index 5e3b4a1..d57bb6e 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -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,
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux