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"
This commit is contained in:
12
cache.h
12
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
|
||||
|
Reference in New Issue
Block a user