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>
This commit is contained in:
Elijah Newren 2023-03-21 06:25:53 +00:00 committed by Junio C Hamano
parent e25cabbf6b
commit a6dc3d364c
28 changed files with 29 additions and 25 deletions

View File

@ -4,7 +4,7 @@
#ifndef BULK_CHECKIN_H #ifndef BULK_CHECKIN_H
#define BULK_CHECKIN_H #define BULK_CHECKIN_H
#include "cache.h" #include "object.h"
void prepare_loose_object_bulk_checkin(void); void prepare_loose_object_bulk_checkin(void);
void fsync_loose_object_bulk_checkin(int fd, const char *filename); void fsync_loose_object_bulk_checkin(int fd, const char *filename);

View File

@ -2,7 +2,6 @@
#define BUNDLE_H #define BUNDLE_H
#include "strvec.h" #include "strvec.h"
#include "cache.h"
#include "string-list.h" #include "string-list.h"
#include "list-objects-filter-options.h" #include "list-objects-filter-options.h"

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "hex.h" #include "hex.h"
#include "lockfile.h" #include "lockfile.h"

View File

@ -5,7 +5,7 @@
* Copyright (C) Johannes Schindelin, 2005 * Copyright (C) Johannes Schindelin, 2005
* *
*/ */
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "date.h" #include "date.h"
#include "branch.h" #include "branch.h"

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "config.h" #include "config.h"
#include "refs.h" #include "refs.h"

2
fsck.c
View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "hex.h" #include "hex.h"
#include "object-store.h" #include "object-store.h"

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "config.h" #include "config.h"
#include "hex.h" #include "hex.h"

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "pack-mtimes.h" #include "pack-mtimes.h"
#include "object-store.h" #include "object-store.h"
#include "packfile.h" #include "packfile.h"

View File

@ -1,11 +1,13 @@
#ifndef PACKFILE_H #ifndef PACKFILE_H
#define PACKFILE_H #define PACKFILE_H
#include "cache.h" #include "object.h"
#include "oidset.h" #include "oidset.h"
/* in object-store.h */ /* in object-store.h */
struct packed_git; struct packed_git;
struct pack_entry;
struct pack_window;
struct object_info; struct object_info;
/* /*

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "object-store.h" #include "object-store.h"
#include "packfile.h" #include "packfile.h"
#include "progress.h" #include "progress.h"

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "hex.h" #include "hex.h"
#include "parse-options.h" #include "parse-options.h"

2
refs.c
View File

@ -2,7 +2,7 @@
* The backend-independent part of the reference module. * The backend-independent part of the reference module.
*/ */
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "config.h" #include "config.h"
#include "hashmap.h" #include "hashmap.h"

1
refs.h
View File

@ -1,7 +1,6 @@
#ifndef REFS_H #ifndef REFS_H
#define REFS_H #define REFS_H
#include "cache.h"
#include "commit.h" #include "commit.h"
struct object_id; struct object_id;

View File

@ -1,4 +1,4 @@
#include "../git-compat-util.h" #include "../cache.h"
#include "../alloc.h" #include "../alloc.h"
#include "../config.h" #include "../config.h"
#include "../hex.h" #include "../hex.h"

View File

@ -1,5 +1,6 @@
#include "git-compat-util.h" #include "git-compat-util.h"
#include "alloc.h" #include "alloc.h"
#include "gettext.h"
#include "hex.h" #include "hex.h"
#include "strvec.h" #include "strvec.h"
#include "refs.h" #include "refs.h"

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "config.h" #include "config.h"
#include "hex.h" #include "hex.h"

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "dir.h" #include "dir.h"
#include "hex.h" #include "hex.h"

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "hex.h" #include "hex.h"
#include "repository.h" #include "repository.h"

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "hex.h" #include "hex.h"
#include "refs.h" #include "refs.h"

View File

@ -3,10 +3,12 @@
*/ */
#ifndef STREAMING_H #ifndef STREAMING_H
#define STREAMING_H 1 #define STREAMING_H 1
#include "cache.h"
#include "object.h"
/* opaque */ /* opaque */
struct git_istream; struct git_istream;
struct stream_filter;
struct git_istream *open_istream(struct repository *, const struct object_id *, struct git_istream *open_istream(struct repository *, const struct object_id *,
enum object_type *, unsigned long *, enum object_type *, unsigned long *,

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "repository.h" #include "repository.h"
#include "config.h" #include "config.h"

View File

@ -1,6 +1,7 @@
#include "test-tool.h" #include "test-tool.h"
#include "parse-options.h" #include "parse-options.h"
#include "bundle-uri.h" #include "bundle-uri.h"
#include "gettext.h"
#include "strbuf.h" #include "strbuf.h"
#include "string-list.h" #include "string-list.h"
#include "transport.h" #include "transport.h"

View File

@ -12,7 +12,7 @@
#define USE_THE_INDEX_VARIABLE #define USE_THE_INDEX_VARIABLE
#include "test-tool.h" #include "test-tool.h"
#include "cache.h"
#include "cache-tree.h" #include "cache-tree.h"
#include "commit.h" #include "commit.h"
#include "hex.h" #include "hex.h"

View File

@ -1,5 +1,5 @@
#include "git-compat-util.h"
#include "test-tool.h" #include "test-tool.h"
#include "cache.h"
#include "hex.h" #include "hex.h"
#include "strbuf.h" #include "strbuf.h"
#include "object-store.h" #include "object-store.h"

View File

@ -1,4 +1,5 @@
#include "test-tool.h" #include "test-tool.h"
#include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "commit.h" #include "commit.h"
#include "commit-reach.h" #include "commit-reach.h"

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "config.h" #include "config.h"
#include "hex.h" #include "hex.h"

View File

@ -1,7 +1,6 @@
#ifndef TRANSPORT_H #ifndef TRANSPORT_H
#define TRANSPORT_H #define TRANSPORT_H
#include "cache.h"
#include "run-command.h" #include "run-command.h"
#include "remote.h" #include "remote.h"
#include "list-objects-filter-options.h" #include "list-objects-filter-options.h"

View File

@ -1,4 +1,4 @@
#include "git-compat-util.h" #include "cache.h"
#include "alloc.h" #include "alloc.h"
#include "repository.h" #include "repository.h"
#include "refs.h" #include "refs.h"