diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-08-21 22:14:14 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-08-22 00:33:23 +0200 |
commit | 976b97e3fd95d5daa38ed453349f5a92157a1db2 (patch) | |
tree | 6788c3b0b91bc68daab8dfcbf7741e6eefbc64e7 /add-interactive.c | |
parent | Git 2.42 (diff) | |
download | git-976b97e3fd95d5daa38ed453349f5a92157a1db2.tar.xz 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 'add-interactive.c')
-rw-r--r-- | add-interactive.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/add-interactive.c b/add-interactive.c index add9a1ad43..7fd00c5e25 100644 --- a/add-interactive.c +++ b/add-interactive.c @@ -569,7 +569,7 @@ static int get_modified_files(struct repository *r, copy_pathspec(&rev.prune_data, ps); if (s.mode == FROM_INDEX) - run_diff_index(&rev, 1); + run_diff_index(&rev, DIFF_INDEX_CACHED); else { rev.diffopt.flags.ignore_dirty_submodules = 1; run_diff_files(&rev, 0); |