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>
This commit is contained in:
Junio C Hamano 2013-07-17 15:27:19 -07:00
Родитель 1ecc1cbd3a
Коммит bf142ec434
1 изменённых файлов: 1 добавлений и 1 удалений

2
diff.c
Просмотреть файл

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