repository.h: move declaration of the_index from cache.h

the_index is a global variable defined in repository.c; as such, its declaration feels better suited living in repository.h rather than cache.h. Move it. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed May 16, 2023 at 06:33 UTC bc47f16db2bccb0398edd93af27086f35a3cb97a
3 files changed +4 -4
cache.h
-4
@@ -312,10 +312,6 @@ typedef int (*must_prefetch_predicate)(const struct cache_entry *);
312 void prefetch_cache_entries(const struct index_state *istate,
313 must_prefetch_predicate must_prefetch);
314
315 -#ifdef USE_THE_INDEX_VARIABLE
316 -extern struct index_state the_index;
317 -#endif
318 -
315 /* Initialize and use the cache information */
316 struct lock_file;
317 int do_read_index(struct index_state *istate, const char *path,
repository.h
+3
@@ -170,6 +170,9 @@ struct repository {
170 };
171
172 extern struct repository *the_repository;
173 +#ifdef USE_THE_INDEX_VARIABLE
174 +extern struct index_state the_index;
175 +#endif
176
177 /*
178 * Define a custom repository layout. Any field can be NULL, which
t/helper/test-dump-split-index.c
+1
@@ -2,6 +2,7 @@
2 #include "test-tool.h"
3 #include "cache.h"
4 #include "hex.h"
5 +#include "repository.h"
6 #include "setup.h"
7 #include "split-index.h"
8 #include "ewah/ewok.h"