Skip to content

Commit

Permalink
diff: reject unknown change class given to --diff-filter
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jul 17, 2013
1 parent 1ecc1cb commit bf142ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -3537,7 +3537,7 @@ static int parse_diff_filter_opt(const char *optarg, struct diff_options *opt)

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

0 comments on commit bf142ec

Please sign in to comment.