Git fork

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>

authored by

Elijah Newren and committed by
Junio C Hamano
a6dc3d36 e25cabbf

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