diff options
author | Denton Liu <liu.denton@gmail.com> | 2020-09-20 14:22:22 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-21 07:30:26 +0300 |
commit | 4c3fe82ef17a6636c742b95cd292b83b02876e08 (patch) | |
tree | 51656928a889f2b66241301f1ea87e450f6b8bbb /diff-lib.c | |
parent | 308d7a7dc99043c90a9eff6916cad1abe0d473aa (diff) |
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>
Diffstat (limited to 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/diff-lib.c b/diff-lib.c index 5d5d3dafab..ed720853ed 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -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"); |