diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-08-21 16:14:14 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-08-21 15:33:23 -0700 |
| commit | 976b97e3fd95d5daa38ed453349f5a92157a1db2 (patch) | |
| tree | 6788c3b0b91bc68daab8dfcbf7741e6eefbc64e7 /builtin/am.c | |
| parent | Git 2.42 (diff) | |
| download | git-976b97e3fd95d5daa38ed453349f5a92157a1db2.tar.gz git-976b97e3fd95d5daa38ed453349f5a92157a1db2.zip | |
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>
Diffstat (limited to 'builtin/am.c')
| -rw-r--r-- | builtin/am.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/am.c b/builtin/am.c index 8bde034fae..202040b62e 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -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); } |
