name-hash.h: move declarations for name-hash.c from cache.h

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 f5653856c26efb2ce722148060518817af2ab023
12 files changed +26 -9
apply.c
+1
@@ -23,6 +23,7 @@
23 #include "xdiff-interface.h"
24 #include "ll-merge.h"
25 #include "lockfile.h"
26 +#include "name-hash.h"
27 #include "object-name.h"
28 #include "object-file.h"
29 #include "parse-options.h"
builtin/mv.c
+1
@@ -11,6 +11,7 @@
11 #include "config.h"
12 #include "environment.h"
13 #include "gettext.h"
14 +#include "name-hash.h"
15 #include "object-file.h"
16 #include "pathspec.h"
17 #include "lockfile.h"
cache.h
-9
@@ -245,12 +245,6 @@ struct index_state {
245 void index_state_init(struct index_state *istate, struct repository *r);
246 void release_index(struct index_state *istate);
247
248 -/* Name hashing */
249 -int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);
250 -void add_name_hash(struct index_state *istate, struct cache_entry *ce);
251 -void remove_name_hash(struct index_state *istate, struct cache_entry *ce);
252 -void free_name_hash(struct index_state *istate);
253 -
248 /* Cache entry creation and cleanup */
249
250 /*
@@ -377,9 +371,6 @@ int repo_index_has_changes(struct repository *repo,
371
372 int verify_path(const char *path, unsigned mode);
373 int strcmp_offset(const char *s1, const char *s2, size_t *first_change);
380 -int index_dir_exists(struct index_state *istate, const char *name, int namelen);
381 -void adjust_dirname_case(struct index_state *istate, char *name);
382 -struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int igncase);
374
375 /*
376 * Searches for an entry defined by name and namelen in the given index.
dir.c
+1
@@ -13,6 +13,7 @@
13 #include "dir.h"
14 #include "environment.h"
15 #include "gettext.h"
16 +#include "name-hash.h"
17 #include "object-file.h"
18 #include "object-store.h"
19 #include "attr.h"
entry.c
+1
@@ -5,6 +5,7 @@
5 #include "environment.h"
6 #include "gettext.h"
7 #include "hex.h"
8 +#include "name-hash.h"
9 #include "streaming.h"
10 #include "submodule.h"
11 #include "symlinks.h"
merge-recursive.c
+1
@@ -23,6 +23,7 @@
23 #include "ll-merge.h"
24 #include "lockfile.h"
25 #include "match-trees.h"
26 +#include "name-hash.h"
27 #include "object-file.h"
28 #include "object-name.h"
29 #include "object-store.h"
name-hash.c
+1
@@ -8,6 +8,7 @@
8 #include "cache.h"
9 #include "environment.h"
10 #include "gettext.h"
11 +#include "name-hash.h"
12 #include "thread-utils.h"
13 #include "trace.h"
14 #include "trace2.h"
name-hash.h new
+16
@@ -0,0 +1,16 @@
1 +#ifndef NAME_HASH_H
2 +#define NAME_HASH_H
3 +
4 +struct cache_entry;
5 +struct index_state;
6 +
7 +int index_dir_exists(struct index_state *istate, const char *name, int namelen);
8 +void adjust_dirname_case(struct index_state *istate, char *name);
9 +struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int igncase);
10 +
11 +int test_lazy_init_name_hash(struct index_state *istate, int try_threaded);
12 +void add_name_hash(struct index_state *istate, struct cache_entry *ce);
13 +void remove_name_hash(struct index_state *istate, struct cache_entry *ce);
14 +void free_name_hash(struct index_state *istate);
15 +
16 +#endif /* NAME_HASH_H */
read-cache.c
+1
@@ -25,6 +25,7 @@
25 #include "environment.h"
26 #include "gettext.h"
27 #include "mem-pool.h"
28 +#include "name-hash.h"
29 #include "object-name.h"
30 #include "resolve-undo.h"
31 #include "revision.h"
sparse-index.c
+1
@@ -2,6 +2,7 @@
2 #include "alloc.h"
3 #include "environment.h"
4 #include "gettext.h"
5 +#include "name-hash.h"
6 #include "repository.h"
7 #include "sparse-index.h"
8 #include "tree.h"
t/helper/test-lazy-init-name-hash.c
+1
@@ -2,6 +2,7 @@
2 #include "test-tool.h"
3 #include "cache.h"
4 #include "environment.h"
5 +#include "name-hash.h"
6 #include "parse-options.h"
7 #include "repository.h"
8 #include "setup.h"
unpack-trees.c
+1
@@ -7,6 +7,7 @@
7 #include "environment.h"
8 #include "gettext.h"
9 #include "hex.h"
10 +#include "name-hash.h"
11 #include "tree.h"
12 #include "tree-walk.h"
13 #include "cache-tree.h"