diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-11-19 16:07:34 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-11-21 06:06:15 +0300 |
commit | dc594180d9e62438cb664c678f5e5bd229154c75 (patch) | |
tree | 10b94b968ae39d1f78cdac0fdaa3238f744f5c41 /builtin/fsck.c | |
parent | 031b2033e0b5c6276bbd93f276e1698f925fb498 (diff) |
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/fsck.c')
-rw-r--r-- | builtin/fsck.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c index 7436e1a68e..cd47675e37 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -961,26 +961,26 @@ int cmd_fsck(int argc, const char **argv, const char *prefix) read_cache(); /* TODO: audit for interaction with sparse-index. */ ensure_full_index(&the_index); - for (i = 0; i < active_nr; i++) { + for (i = 0; i < the_index.cache_nr; i++) { unsigned int mode; struct blob *blob; struct object *obj; - mode = active_cache[i]->ce_mode; + mode = the_index.cache[i]->ce_mode; if (S_ISGITLINK(mode)) continue; blob = lookup_blob(the_repository, - &active_cache[i]->oid); + &the_index.cache[i]->oid); if (!blob) continue; obj = &blob->object; obj->flags |= USED; fsck_put_object_name(&fsck_walk_options, &obj->oid, - ":%s", active_cache[i]->name); + ":%s", the_index.cache[i]->name); mark_object_reachable(obj); } - if (active_cache_tree) - fsck_cache_tree(active_cache_tree); + if (the_index.cache_tree) + fsck_cache_tree(the_index.cache_tree); fsck_resolve_undo(&the_index); } |