Skip to content

Commit bf142ec

Browse files
committed
diff: reject unknown change class given to --diff-filter
We used to accept "git diff --diff-filter=Q" (note that there is no such change class 'Q') silently and showed no output (because there is no such change class 'Q'). Error out when such an input is given. Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1ecc1cb commit bf142ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3537,7 +3537,7 @@ static int parse_diff_filter_opt(const char *optarg, struct diff_options *opt)
35373537

35383538
bit = (0 <= optch && optch <= 'Z') ? filter_bit[optch] : 0;
35393539
if (!bit)
3540-
continue; /* ignore unknown ones, like we always have */
3540+
return optarg[i];
35413541
opt->filter |= bit;
35423542
}
35433543
return 0;

0 commit comments

Comments
 (0)