DORMANTno replies

[PATCH] diff-lib.c: Fix diff-files --diff-filter --quiet exit code

From: Jakob Pfender <hidden>
Date: 2016-06-15 22:50:47
Subsystem: the rest · Maintainer: Linus Torvalds

Given the following status:

	$ git status -s
	 M bar
	UU foo

There is an unexpected difference in the return code of git diff-files
when used with --quiet as opposed to --exit-code:

	$ git diff-files --diff-filter=U --quiet
	$ echo $?
	0

	$ git diff-files --diff-filter=U --exit-code
	<usual output, lots of 0's and U<TAB>foo>
	$ echo $?
	1

Notice the different return codes. Now, according to the documentation,
--quiet implies --return-code. However, the return code of the former is
clearly not correct if --return-code was supposed to be on.

This patch removes a useless bit of code that caused the return codes to
differ.

Signed-off-by: Jakob Pfender <redacted>
---
  diff-lib.c |    4 ----
  1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/diff-lib.c b/diff-lib.c
index 392ce2b..a7aa42b 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -102,10 +102,6 @@ int run_diff_files(struct rev_info *revs, unsigned 
int option)
  		int changed;
  		unsigned dirty_submodule = 0;

-		if (DIFF_OPT_TST(&revs->diffopt, QUICK) &&
-			DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES))
-			break;
-
  		if (!ce_path_match(ce, revs->prune_data))
  			continue;

-- 
1.7.0.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help