treewide: remove unnecessary cache.h includes

We had several header files include cache.h unnecessarily. Remove those. These have all been verified via both ensuring that gcc -E $HEADER | grep '"cache.h"' found no hits and that cat >temp.c <<EOF && #include "git-compat-util.h" #include "$HEADER" int main() {} EOF gcc -c temp.c successfully compiles without warnings. 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 ba3d1c73daa02152acf4729d45ca7fe4d71d5747
10 files changed +7 -11
checkout.h
+1 -1
@@ -1,7 +1,7 @@
1 #ifndef CHECKOUT_H
2 #define CHECKOUT_H
3
4 -#include "cache.h"
4 +#include "hash.h"
5
6 /*
7 * Check if the branch name uniquely matches a branch name on a remote
entry.h
+3 -1
@@ -1,9 +1,11 @@
1 #ifndef ENTRY_H
2 #define ENTRY_H
3
4 -#include "cache.h"
4 #include "convert.h"
5
6 +struct cache_entry;
7 +struct index_state;
8 +
9 struct checkout {
10 struct index_state *istate;
11 const char *base_dir;
khash.h
-1
@@ -26,7 +26,6 @@
26 #ifndef __AC_KHASH_H
27 #define __AC_KHASH_H
28
29 -#include "cache.h"
29 #include "hashmap.h"
30
31 #define AC_VERSION_KHASH_H "0.2.8"
oidmap.h
-1
@@ -1,7 +1,6 @@
1 #ifndef OIDMAP_H
2 #define OIDMAP_H
3
4 -#include "cache.h"
4 #include "hashmap.h"
5
6 /*
pretty.h
+1 -1
@@ -1,11 +1,11 @@
1 #ifndef PRETTY_H
2 #define PRETTY_H
3
4 -#include "cache.h"
4 #include "date.h"
5 #include "string-list.h"
6
7 struct commit;
8 +struct repository;
9 struct strbuf;
10 struct process_trailer_options;
11
reflog-walk.h
-2
@@ -1,8 +1,6 @@
1 #ifndef REFLOG_WALK_H
2 #define REFLOG_WALK_H
3
4 -#include "cache.h"
5 -
4 struct commit;
5 struct reflog_walk_info;
6 struct date_mode;
refs/refs-internal.h
-1
@@ -1,7 +1,6 @@
1 #ifndef REFS_REFS_INTERNAL_H
2 #define REFS_REFS_INTERNAL_H
3
4 -#include "cache.h"
4 #include "refs.h"
5 #include "iterator.h"
6
remote.h
-1
@@ -1,7 +1,6 @@
1 #ifndef REMOTE_H
2 #define REMOTE_H
3
4 -#include "cache.h"
4 #include "parse-options.h"
5 #include "hashmap.h"
6 #include "refspec.h"
sequencer.h
+1 -1
@@ -1,11 +1,11 @@
1 #ifndef SEQUENCER_H
2 #define SEQUENCER_H
3
4 -#include "cache.h"
4 #include "strbuf.h"
5 #include "wt-status.h"
6
7 struct commit;
8 +struct index_state;
9 struct repository;
10
11 const char *git_path_commit_editmsg(void);
xdiff-interface.h
+1 -1
@@ -1,7 +1,7 @@
1 #ifndef XDIFF_INTERFACE_H
2 #define XDIFF_INTERFACE_H
3
4 -#include "cache.h"
4 +#include "hash.h"
5 #include "xdiff/xdiff.h"
6
7 /*