Skip to content

Commit bc47f16

Browse files
newrengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 750324d commit bc47f16

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cache.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,6 @@ typedef int (*must_prefetch_predicate)(const struct cache_entry *);
312312
void prefetch_cache_entries(const struct index_state *istate,
313313
must_prefetch_predicate must_prefetch);
314314

315-
#ifdef USE_THE_INDEX_VARIABLE
316-
extern struct index_state the_index;
317-
#endif
318-
319315
/* Initialize and use the cache information */
320316
struct lock_file;
321317
int do_read_index(struct index_state *istate, const char *path,

repository.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ struct repository {
170170
};
171171

172172
extern struct repository *the_repository;
173+
#ifdef USE_THE_INDEX_VARIABLE
174+
extern struct index_state the_index;
175+
#endif
173176

174177
/*
175178
* Define a custom repository layout. Any field can be NULL, which

t/helper/test-dump-split-index.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "test-tool.h"
33
#include "cache.h"
44
#include "hex.h"
5+
#include "repository.h"
56
#include "setup.h"
67
#include "split-index.h"
78
#include "ewah/ewok.h"

0 commit comments

Comments
 (0)