Skip to content

Commit bcf3d1f

Browse files
committed
Merge branch 'jc/maint-diff-q-filter' into maint
* jc/maint-diff-q-filter: diff --quiet: disable optimization when --diff-filter=X is used
2 parents bf87e09 + 2cfe8a6 commit bcf3d1f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

diff-lib.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
103103
unsigned dirty_submodule = 0;
104104

105105
if (DIFF_OPT_TST(&revs->diffopt, QUICK) &&
106-
DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES))
106+
!revs->diffopt.filter &&
107+
DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES))
107108
break;
108109

109110
if (!ce_path_match(ce, revs->prune_data))

t/t4040-whitespace-status.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,11 @@ test_expect_success 'diff-files -b -p --exit-code' '
6060
git diff-files -b -p --exit-code
6161
'
6262

63+
test_expect_success 'diff-files --diff-filter --quiet' '
64+
git reset --hard &&
65+
rm a/d &&
66+
echo x >>b/e &&
67+
test_must_fail git diff-files --diff-filter=M --quiet
68+
'
69+
6370
test_done

0 commit comments

Comments
 (0)