DORMANTno replies

[PATCH] diff: squelch empty diffs even more

From: René Scharfe <hidden>
Date: 2016-06-15 22:43:29
Subsystem: the rest · Maintainer: Linus Torvalds

When we compare two non-tracked files or explicitly specify
--no-index then the suggestion to run git-status is not helpful.
max_count is set to -2 in these cases; don't print the warning
then.

Signed-off-by: Rene Scharfe <redacted>
---

 builtin-diff.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin-diff.c b/builtin-diff.c
index 6ed7b68..b2fd8c8 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -346,8 +346,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 	if (rev.diffopt.exit_with_status)
 		result = rev.diffopt.has_changes;
 
-	if ((rev.diffopt.output_format & DIFF_FORMAT_PATCH)
-	    && (1 < rev.diffopt.skip_stat_unmatch))
+	if ((rev.diffopt.output_format & DIFF_FORMAT_PATCH) &&
+	    1 < rev.diffopt.skip_stat_unmatch && rev.max_count != -2)
 		printf("Warning: %d path%s touched but unmodified. "
 		       "Consider running git-status.\n",
 		       rev.diffopt.skip_stat_unmatch - 1,
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help