diff: spell DIFF_INDEX_CACHED out when calling run_diff_index()
Many callers of run_diff_index() passed literal "1" for the option flag word, which should better be spelled out as DIFF_INDEX_CACHED for readablity. Everybody else passes "0" that can stay as-is. The other bit in the option flag word is DIFF_INDEX_MERGE_BASE, but curiously there is only one caller that can pass it, which is "git diff-index --merge-base" itself---no internal callers uses the feature. A bit tricky call to the function is in builtin/submodule--helper.c where the .cached member in a private struct is set/reset as a plain Boolean flag, which happens to be "1" and happens to match the value of DIFF_INDEX_CACHED. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@ -1430,7 +1430,7 @@ static void write_index_patch(const struct am_state *state)
|
||||
rev_info.diffopt.close_file = 1;
|
||||
add_pending_object(&rev_info, &tree->object, "");
|
||||
diff_setup_done(&rev_info.diffopt);
|
||||
run_diff_index(&rev_info, 1);
|
||||
run_diff_index(&rev_info, DIFF_INDEX_CACHED);
|
||||
release_revisions(&rev_info);
|
||||
}
|
||||
|
||||
@ -1593,7 +1593,7 @@ static int fall_back_threeway(const struct am_state *state, const char *index_pa
|
||||
rev_info.diffopt.filter |= diff_filter_bit('M');
|
||||
add_pending_oid(&rev_info, "HEAD", &our_tree, 0);
|
||||
diff_setup_done(&rev_info.diffopt);
|
||||
run_diff_index(&rev_info, 1);
|
||||
run_diff_index(&rev_info, DIFF_INDEX_CACHED);
|
||||
release_revisions(&rev_info);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user