replace-object.h: move read_replace_refs declaration from cache.h to here

Adjust several files to be more explicit about their dependency on replace-objects to accommodate this change. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Feb 24, 2023 at 00:09 UTC cbeab74713b6a97dfe6cf9e3bd9dbf7c68ea4e7b
15 files changed +21 -9
builtin/cat-file.c
+1
@@ -18,6 +18,7 @@
18 #include "oid-array.h"
19 #include "packfile.h"
20 #include "object-store.h"
21 +#include "replace-object.h"
22 #include "promisor-remote.h"
23 #include "mailmap.h"
24
builtin/commit-graph.c
+1
@@ -8,6 +8,7 @@
8 #include "commit-graph.h"
9 #include "object-store.h"
10 #include "progress.h"
11 +#include "replace-object.h"
12 #include "tag.h"
13
14 #define BUILTIN_COMMIT_GRAPH_VERIFY_USAGE \
builtin/fsck.c
+1
@@ -20,6 +20,7 @@
20 #include "decorate.h"
21 #include "packfile.h"
22 #include "object-store.h"
23 +#include "replace-object.h"
24 #include "resolve-undo.h"
25 #include "run-command.h"
26 #include "worktree.h"
builtin/index-pack.c
+1
@@ -16,6 +16,7 @@
16 #include "thread-utils.h"
17 #include "packfile.h"
18 #include "object-store.h"
19 +#include "replace-object.h"
20 #include "promisor-remote.h"
21
22 static const char index_pack_usage[] =
builtin/pack-objects.c
+1
@@ -32,6 +32,7 @@
32 #include "list.h"
33 #include "packfile.h"
34 #include "object-store.h"
35 +#include "replace-object.h"
36 #include "dir.h"
37 #include "midx.h"
38 #include "trace2.h"
builtin/prune.c
+1
@@ -8,6 +8,7 @@
8 #include "parse-options.h"
9 #include "progress.h"
10 #include "prune-packed.h"
11 +#include "replace-object.h"
12 #include "object-store.h"
13 #include "shallow.h"
14
builtin/replace.c
+1
@@ -16,6 +16,7 @@
16 #include "parse-options.h"
17 #include "run-command.h"
18 #include "object-store.h"
19 +#include "replace-object.h"
20 #include "repository.h"
21 #include "tag.h"
22
builtin/unpack-objects.c
+1
@@ -9,6 +9,7 @@
9 #include "pack.h"
10 #include "blob.h"
11 #include "commit.h"
12 +#include "replace-object.h"
13 #include "tag.h"
14 #include "tree.h"
15 #include "tree-walk.h"
builtin/upload-pack.c
+1
@@ -4,6 +4,7 @@
4 #include "pkt-line.h"
5 #include "parse-options.h"
6 #include "protocol.h"
7 +#include "replace-object.h"
8 #include "upload-pack.h"
9 #include "serve.h"
10
cache.h
-8
@@ -886,14 +886,6 @@ void set_shared_repository(int value);
886 int get_shared_repository(void);
887 void reset_shared_repository(void);
888
889 -/*
890 - * Do replace refs need to be checked this run? This variable is
891 - * initialized to true unless --no-replace-object is used or
892 - * $GIT_NO_REPLACE_OBJECTS is set, but is set to false by some
893 - * commands that do not want replace references to be active.
894 - */
895 -extern int read_replace_refs;
896 -
889 /*
890 * These values are used to help identify parts of a repository to fsync.
891 * FSYNC_COMPONENT_NONE identifies data that will not be a persistent part of the
config.c
+1
@@ -23,6 +23,7 @@
23 #include "utf8.h"
24 #include "dir.h"
25 #include "color.h"
26 +#include "replace-object.h"
27 #include "refs.h"
28 #include "worktree.h"
29
environment.c
+1
@@ -17,6 +17,7 @@
17 #include "commit.h"
18 #include "strvec.h"
19 #include "object-store.h"
20 +#include "replace-object.h"
21 #include "tmp-objdir.h"
22 #include "chdir-notify.h"
23 #include "shallow.h"
git.c
+1
@@ -4,6 +4,7 @@
4 #include "help.h"
5 #include "run-command.h"
6 #include "alias.h"
7 +#include "replace-object.h"
8 #include "shallow.h"
9
10 #define RUN_SETUP (1<<0)
log-tree.c
+1
@@ -13,6 +13,7 @@
13 #include "merge-ort.h"
14 #include "reflog-walk.h"
15 #include "refs.h"
16 +#include "replace-object.h"
17 #include "string-list.h"
18 #include "color.h"
19 #include "gpg-interface.h"
replace-object.h
+8 -1
@@ -1,11 +1,18 @@
1 #ifndef REPLACE_OBJECT_H
2 #define REPLACE_OBJECT_H
3
4 -#include "cache.h"
4 #include "oidmap.h"
5 #include "repository.h"
6 #include "object-store.h"
7
8 +/*
9 + * Do replace refs need to be checked this run? This variable is
10 + * initialized to true unless --no-replace-object is used or
11 + * $GIT_NO_REPLACE_OBJECTS is set, but is set to false by some
12 + * commands that do not want replace references to be active.
13 + */
14 +extern int read_replace_refs;
15 +
16 struct replace_object {
17 struct oidmap_entry original;
18 struct object_id replacement;