diff-lib: accept option flags in run_diff_index()

In a future commit, we will teach run_diff_index() to accept more
options via flag bits. For now, change `cached` into a flag in the
`option` bitfield. The behaviour should remain exactly the same.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Denton Liu
2020-09-20 04:22:22 -07:00
committed by Junio C Hamano
parent 308d7a7dc9
commit 4c3fe82ef1
4 changed files with 13 additions and 10 deletions

View File

@ -512,9 +512,10 @@ static int diff_cache(struct rev_info *revs,
return unpack_trees(1, &t, &opts);
}
int run_diff_index(struct rev_info *revs, int cached)
int run_diff_index(struct rev_info *revs, unsigned int option)
{
struct object_array_entry *ent;
int cached = !!(option & DIFF_INDEX_CACHED);
if (revs->pending.nr != 1)
BUG("run_diff_index must be passed exactly one tree");