treewide: remove unnecessary cache.h inclusion from a few headers

Ever since a64215b6cd ("object.h: stop depending on cache.h; make cache.h depend on object.h", 2023-02-24), we have a few headers that could have replaced their include of cache.h with an include of object.h. Make that change now. Some C files had to start including cache.h after this change (or some smaller header it had brought in), because the C files were depending on things from cache.h but were only formerly implicitly getting cache.h through one of these headers being modified in this patch. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Mar 21, 2023 at 06:25 UTC a6dc3d364cdf89075582cd521f33d599e6b53cf2
28 files changed +29 -25
bulk-checkin.h
+1 -1
@@ -4,7 +4,7 @@
4 #ifndef BULK_CHECKIN_H
5 #define BULK_CHECKIN_H
6
7 -#include "cache.h"
7 +#include "object.h"
8
9 void prepare_loose_object_bulk_checkin(void);
10 void fsync_loose_object_bulk_checkin(int fd, const char *filename);
bundle.h
-1
@@ -2,7 +2,6 @@
2 #define BUNDLE_H
3
4 #include "strvec.h"
5 -#include "cache.h"
5 #include "string-list.h"
6 #include "list-objects-filter-options.h"
7
cache-tree.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "alloc.h"
3 #include "hex.h"
4 #include "lockfile.h"
config.c
+1 -1
@@ -5,7 +5,7 @@
5 * Copyright (C) Johannes Schindelin, 2005
6 *
7 */
8 -#include "git-compat-util.h"
8 +#include "cache.h"
9 #include "alloc.h"
10 #include "date.h"
11 #include "branch.h"
fmt-merge-msg.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "alloc.h"
3 #include "config.h"
4 #include "refs.h"
fsck.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "alloc.h"
3 #include "hex.h"
4 #include "object-store.h"
http-backend.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "alloc.h"
3 #include "config.h"
4 #include "hex.h"
pack-mtimes.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "pack-mtimes.h"
3 #include "object-store.h"
4 #include "packfile.h"
packfile.h
+3 -1
@@ -1,11 +1,13 @@
1 #ifndef PACKFILE_H
2 #define PACKFILE_H
3
4 -#include "cache.h"
4 +#include "object.h"
5 #include "oidset.h"
6
7 /* in object-store.h */
8 struct packed_git;
9 +struct pack_entry;
10 +struct pack_window;
11 struct object_info;
12
13 /*
prune-packed.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "object-store.h"
3 #include "packfile.h"
4 #include "progress.h"
ref-filter.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "alloc.h"
3 #include "hex.h"
4 #include "parse-options.h"
refs.c
+1 -1
@@ -2,7 +2,7 @@
2 * The backend-independent part of the reference module.
3 */
4
5 -#include "git-compat-util.h"
5 +#include "cache.h"
6 #include "alloc.h"
7 #include "config.h"
8 #include "hashmap.h"
refs.h
-1
@@ -1,7 +1,6 @@
1 #ifndef REFS_H
2 #define REFS_H
3
4 -#include "cache.h"
4 #include "commit.h"
5
6 struct object_id;
refs/packed-backend.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "../git-compat-util.h"
1 +#include "../cache.h"
2 #include "../alloc.h"
3 #include "../config.h"
4 #include "../hex.h"
refspec.c
+1
@@ -1,5 +1,6 @@
1 #include "git-compat-util.h"
2 #include "alloc.h"
3 +#include "gettext.h"
4 #include "hex.h"
5 #include "strvec.h"
6 #include "refs.h"
remote.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "alloc.h"
3 #include "config.h"
4 #include "hex.h"
server-info.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "alloc.h"
3 #include "dir.h"
4 #include "hex.h"
shallow.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "alloc.h"
3 #include "hex.h"
4 #include "repository.h"
strbuf.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "alloc.h"
3 #include "hex.h"
4 #include "refs.h"
streaming.h
+3 -1
@@ -3,10 +3,12 @@
3 */
4 #ifndef STREAMING_H
5 #define STREAMING_H 1
6 -#include "cache.h"
6 +
7 +#include "object.h"
8
9 /* opaque */
10 struct git_istream;
11 +struct stream_filter;
12
13 struct git_istream *open_istream(struct repository *, const struct object_id *,
14 enum object_type *, unsigned long *,
submodule.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "alloc.h"
3 #include "repository.h"
4 #include "config.h"
t/helper/test-bundle-uri.c
+1
@@ -1,6 +1,7 @@
1 #include "test-tool.h"
2 #include "parse-options.h"
3 #include "bundle-uri.h"
4 +#include "gettext.h"
5 #include "strbuf.h"
6 #include "string-list.h"
7 #include "transport.h"
t/helper/test-fast-rebase.c
+1 -1
@@ -12,7 +12,7 @@
12
13 #define USE_THE_INDEX_VARIABLE
14 #include "test-tool.h"
15 -
15 +#include "cache.h"
16 #include "cache-tree.h"
17 #include "commit.h"
18 #include "hex.h"
t/helper/test-pack-mtimes.c
+1 -1
@@ -1,5 +1,5 @@
1 -#include "git-compat-util.h"
1 #include "test-tool.h"
2 +#include "cache.h"
3 #include "hex.h"
4 #include "strbuf.h"
5 #include "object-store.h"
t/helper/test-reach.c
+1
@@ -1,4 +1,5 @@
1 #include "test-tool.h"
2 +#include "cache.h"
3 #include "alloc.h"
4 #include "commit.h"
5 #include "commit-reach.h"
transport.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "alloc.h"
3 #include "config.h"
4 #include "hex.h"
transport.h
-1
@@ -1,7 +1,6 @@
1 #ifndef TRANSPORT_H
2 #define TRANSPORT_H
3
4 -#include "cache.h"
4 #include "run-command.h"
5 #include "remote.h"
6 #include "list-objects-filter-options.h"
worktree.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include "git-compat-util.h"
1 +#include "cache.h"
2 #include "alloc.h"
3 #include "repository.h"
4 #include "refs.h"