diff options
-rw-r--r-- | diff-lib.c | 3 | ||||
-rwxr-xr-x | t/t4037-whitespace-status.sh | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/diff-lib.c b/diff-lib.c index b7813af614..bfa6503373 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -74,7 +74,8 @@ int run_diff_files(struct rev_info *revs, unsigned int option) int changed; if (DIFF_OPT_TST(&revs->diffopt, QUICK) && - DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES)) + !revs->diffopt.filter && + DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES)) break; if (!ce_path_match(ce, revs->prune_data)) diff --git a/t/t4037-whitespace-status.sh b/t/t4037-whitespace-status.sh index a30b03bcf2..abc49348b1 100755 --- a/t/t4037-whitespace-status.sh +++ b/t/t4037-whitespace-status.sh @@ -60,4 +60,11 @@ test_expect_success 'diff-files -b -p --exit-code' ' git diff-files -b -p --exit-code ' +test_expect_success 'diff-files --diff-filter --quiet' ' + git reset --hard && + rm a/d && + echo x >>b/e && + test_must_fail git diff-files --diff-filter=M --quiet +' + test_done |