diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-03-24 11:20:14 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-03-24 16:21:24 +0300 |
commit | cdb5330a9baa64c28473fb0f446ca2242d6971fb (patch) | |
tree | ed2418ab41323ba875ac13d5969a085614873457 /diff.c | |
parent | 16bb3d714dcb1bf50f7f96b957c4306dc6df137e (diff) |
am: avoid diff_opt_parse()
diff_opt_parse() is a heavy hammer to just set diff filter. But it's
the only way because of the diff_status_letters[] mapping. Add a new
API to set diff filter and use it in git-am. diff_opt_parse()'s only
remaining call site in revision.c will be gone soon and having it here
just because of git-am does not make sense.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -4692,6 +4692,12 @@ static unsigned filter_bit_tst(char status, const struct diff_options *opt) return opt->filter & filter_bit[(int) status]; } +unsigned diff_filter_bit(char status) +{ + prepare_filter_bits(); + return filter_bit[(int) status]; +} + static int diff_opt_diff_filter(const struct option *option, const char *optarg, int unset) { |