Skip to content

Commit 50d9c34

Browse files
committed
Merge branch 'jk/all-negative-diff-filter-fix'
A diff-filter with negative-only specification like "git log --diff-filter=d" did not trigger correctly, which has been fixed. * jk/all-negative-diff-filter-fix: setup_revisions(): turn on diffs for all-negative diff filter
2 parents f96878e + 375ac08 commit 50d9c34

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

revision.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3112,7 +3112,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
31123112

31133113
/* Pickaxe, diff-filter and rename following need diffs */
31143114
if ((revs->diffopt.pickaxe_opts & DIFF_PICKAXE_KINDS_MASK) ||
3115-
revs->diffopt.filter ||
3115+
revs->diffopt.filter || revs->diffopt.filter_not ||
31163116
revs->diffopt.flags.follow_renames)
31173117
revs->diff = 1;
31183118

t/t4202-log.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ test_expect_success 'diff-filter=D' '
134134
135135
'
136136

137+
test_expect_success 'all-negative filter' '
138+
git log --no-renames --format=%s --diff-filter=d HEAD >actual &&
139+
printf "%s\n" fifth fourth third second initial >expect &&
140+
test_cmp expect actual
141+
'
142+
137143
test_expect_success 'diff-filter=R' '
138144
139145
git log -M --pretty="format:%s" --diff-filter=R HEAD >actual &&

0 commit comments

Comments
 (0)