]> git.ipfire.org Git - thirdparty/git.git/commitdiff
repository.h: move declaration of the_index from cache.h
authorElijah Newren <newren@gmail.com>
Tue, 16 May 2023 06:33:55 +0000 (06:33 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Jun 2023 20:39:53 +0000 (13:39 -0700)
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>
cache.h
repository.h
t/helper/test-dump-split-index.c

diff --git a/cache.h b/cache.h
index 5b690b80a167f411b40a664423c6816f3254141a..1188289774177b6310fd2228edecfa44c9408016 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -312,10 +312,6 @@ typedef int (*must_prefetch_predicate)(const struct cache_entry *);
 void prefetch_cache_entries(const struct index_state *istate,
                            must_prefetch_predicate must_prefetch);
 
-#ifdef USE_THE_INDEX_VARIABLE
-extern struct index_state the_index;
-#endif
-
 /* Initialize and use the cache information */
 struct lock_file;
 int do_read_index(struct index_state *istate, const char *path,
index 655a95026d3d115d5b658d967da8ce79487caf9d..1cb314721cad6c2121dec6288ade07a3a68169b8 100644 (file)
@@ -170,6 +170,9 @@ struct repository {
 };
 
 extern struct repository *the_repository;
+#ifdef USE_THE_INDEX_VARIABLE
+extern struct index_state the_index;
+#endif
 
 /*
  * Define a custom repository layout. Any field can be NULL, which
index d1badd711263f9192c72854de6de73dd4bc76a88..63fde9157c412c87cb391c25202de9ee1ce4e95d 100644 (file)
@@ -2,6 +2,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "hex.h"
+#include "repository.h"
 #include "setup.h"
 #include "split-index.h"
 #include "ewah/ewok.h"