diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-11-19 14:07:34 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-11-21 12:06:15 +0900 |
commit | dc594180d9e62438cb664c678f5e5bd229154c75 (patch) | |
tree | 10b94b968ae39d1f78cdac0fdaa3238f744f5c41 /builtin/reset.c | |
parent | 031b2033e0b5c6276bbd93f276e1698f925fb498 (diff) | |
download | git-dc594180d9e62438cb664c678f5e5bd229154c75.tar.gz |
cocci & cache.h: apply variable section of "pending" index-compatibility
Mostly apply the part of "index-compatibility.pending.cocci" that
renames the global variables like "active_nr", which are a shorthand
to referencing (in that case) a struct member as "the_index.cache_nr".
In doing so move more of "index-compatibility.pending.cocci" to
"index-compatibility.cocci".
In the case of "active_nr" we'd have a textual conflict with
"ab/various-leak-fixes" in "next"[1]. Let's exclude that specific case
while moving the rule over from "pending".
1. 407b94280f8 (commit: discard partial cache before (re-)reading it,
2022-11-08)
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/reset.c')
-rw-r--r-- | builtin/reset.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/reset.c b/builtin/reset.c index 59f777a1da..75e061f5dc 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -161,7 +161,7 @@ static void update_index_from_diff(struct diff_queue_struct *q, * to properly construct the reset sparse directory. */ pos = cache_name_pos(one->path, strlen(one->path)); - if ((pos >= 0 && ce_skip_worktree(active_cache[pos])) || + if ((pos >= 0 && ce_skip_worktree(the_index.cache[pos])) || (pos < 0 && !path_in_sparse_checkout(one->path, &the_index))) ce->ce_flags |= CE_SKIP_WORKTREE; |