aboutsummaryrefslogtreecommitdiffstats
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-02-22 14:55:44 -0800
committerJunio C Hamano <gitster@pobox.com>2023-02-22 14:55:44 -0800
commit24fb150dcd6b18b6d14ed14a02c6a17c33f0d443 (patch)
treece6f4b23b7d5344b77ad34528256f00e9ede5855 /cache.h
parentMerge branch 'en/name-rev-make-taggerdate-much-less-important' (diff)
parentcocci & cache.h: remove "USE_THE_INDEX_COMPATIBILITY_MACROS" (diff)
downloadgit-24fb150dcd6b18b6d14ed14a02c6a17c33f0d443.tar.gz
git-24fb150dcd6b18b6d14ed14a02c6a17c33f0d443.zip
Merge branch 'ab/the-index-compatibility'
Remove more remaining uses of macros that relies on the_index singleton instance without explicitly spelling it out. * ab/the-index-compatibility: cocci & cache.h: remove "USE_THE_INDEX_COMPATIBILITY_MACROS" cache-tree API: remove redundant update_main_cache_tree() cocci & cache-tree.h: migrate "write_cache_as_tree" to "*_index_*" cocci & cache.h: apply pending "index_cache_pos" rule cocci & cache.h: fully apply "active_nr" part of index-compatibility builtin/rm.c: use narrower "USE_THE_INDEX_VARIABLE"
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/cache.h b/cache.h
index 52d017335e..12789903e8 100644
--- a/cache.h
+++ b/cache.h
@@ -449,18 +449,8 @@ typedef int (*must_prefetch_predicate)(const struct cache_entry *);
void prefetch_cache_entries(const struct index_state *istate,
must_prefetch_predicate must_prefetch);
-#if defined(USE_THE_INDEX_COMPATIBILITY_MACROS) || defined(USE_THE_INDEX_VARIABLE)
+#ifdef USE_THE_INDEX_VARIABLE
extern struct index_state the_index;
-
-#ifndef USE_THE_INDEX_VARIABLE
-#ifdef USE_THE_INDEX_COMPATIBILITY_MACROS
-#define active_nr (the_index.cache_nr)
-
-#define read_cache() repo_read_index(the_repository)
-#define discard_cache() discard_index(&the_index)
-#define cache_name_pos(name, namelen) index_name_pos(&the_index,(name),(namelen))
-#endif
-#endif
#endif
#define TYPE_BITS 3