summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xt/t4037-whitespace-status.sh5
-rw-r--r--tree-diff.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/t/t4037-whitespace-status.sh b/t/t4037-whitespace-status.sh
index abc4934..3c728a3 100755
--- a/t/t4037-whitespace-status.sh
+++ b/t/t4037-whitespace-status.sh
@@ -67,4 +67,9 @@ test_expect_success 'diff-files --diff-filter --quiet' '
test_must_fail git diff-files --diff-filter=M --quiet
'
+test_expect_success 'diff-tree --diff-filter --quiet' '
+ git commit -a -m "worktree state" &&
+ test_must_fail git diff-tree --diff-filter=M --quiet HEAD^ HEAD
+'
+
test_done
diff --git a/tree-diff.c b/tree-diff.c
index 7d745b4..70bdb89 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -287,6 +287,7 @@ int diff_tree(struct tree_desc *t1, struct tree_desc *t2, const char *base, stru
for (;;) {
if (DIFF_OPT_TST(opt, QUICK) &&
+ !opt->filter &&
DIFF_OPT_TST(opt, HAS_CHANGES))
break;
if (opt->nr_paths) {