]> git.ipfire.org Git - thirdparty/git.git/commitdiff
treewide: remove unnecessary cache.h includes
authorElijah Newren <newren@gmail.com>
Fri, 24 Feb 2023 00:09:22 +0000 (00:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 Feb 2023 01:25:28 +0000 (17:25 -0800)
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>
checkout.h
entry.h
khash.h
oidmap.h
pretty.h
reflog-walk.h
refs/refs-internal.h
remote.h
sequencer.h
xdiff-interface.h

index 1152133bd77a773f40afd6c3477224e051318e0c..1917f3b32300abf113bf3128450da26eb2efd9b4 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef CHECKOUT_H
 #define CHECKOUT_H
 
-#include "cache.h"
+#include "hash.h"
 
 /*
  * Check if the branch name uniquely matches a branch name on a remote
diff --git a/entry.h b/entry.h
index 2d4fbb88c8ffabbd36faec0247d5a39a30f99c4f..7329f918a97ee3f80aeeaff07e4236143fcf3cbf 100644 (file)
--- a/entry.h
+++ b/entry.h
@@ -1,9 +1,11 @@
 #ifndef ENTRY_H
 #define ENTRY_H
 
-#include "cache.h"
 #include "convert.h"
 
+struct cache_entry;
+struct index_state;
+
 struct checkout {
        struct index_state *istate;
        const char *base_dir;
diff --git a/khash.h b/khash.h
index cb79bf885674ea6fc54fdcea17543739530a3b14..85362718c565e727da2beb9b10c9f32dd44a505a 100644 (file)
--- a/khash.h
+++ b/khash.h
@@ -26,7 +26,6 @@
 #ifndef __AC_KHASH_H
 #define __AC_KHASH_H
 
-#include "cache.h"
 #include "hashmap.h"
 
 #define AC_VERSION_KHASH_H "0.2.8"
index c66a83ab1d6891dbe6916d13339b64456b8cc440..c1642927fa614764312b0ebccd05a77d12a07388 100644 (file)
--- a/oidmap.h
+++ b/oidmap.h
@@ -1,7 +1,6 @@
 #ifndef OIDMAP_H
 #define OIDMAP_H
 
-#include "cache.h"
 #include "hashmap.h"
 
 /*
index f34e24c53a4925aec51cd62117654fdd5f7f980e..9508c22f03060f47db11b0969e41e94d388cd70c 100644 (file)
--- a/pretty.h
+++ b/pretty.h
@@ -1,11 +1,11 @@
 #ifndef PRETTY_H
 #define PRETTY_H
 
-#include "cache.h"
 #include "date.h"
 #include "string-list.h"
 
 struct commit;
+struct repository;
 struct strbuf;
 struct process_trailer_options;
 
index 8076f10d9fbc0dd5588582f5bfec105416037233..4d93a269571980772c49cb25d37749a033482b4f 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef REFLOG_WALK_H
 #define REFLOG_WALK_H
 
-#include "cache.h"
-
 struct commit;
 struct reflog_walk_info;
 struct date_mode;
index 69f93b0e2ac9fa9ec2778b783fa98792030c327e..a85d113123c99b55e1e7047d334c7608843eb2d6 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef REFS_REFS_INTERNAL_H
 #define REFS_REFS_INTERNAL_H
 
-#include "cache.h"
 #include "refs.h"
 #include "iterator.h"
 
index 1ebbe42792ec67230b62dbbe4cb8ed9646576858..5b38ee20b843bbb90655677c28132a9523411bd0 100644 (file)
--- a/remote.h
+++ b/remote.h
@@ -1,7 +1,6 @@
 #ifndef REMOTE_H
 #define REMOTE_H
 
-#include "cache.h"
 #include "parse-options.h"
 #include "hashmap.h"
 #include "refspec.h"
index 3bcdfa1b5865fc5209141870076b7325edfa36d4..33dbaf5b66d8bd803de8b0dfdc7d25300ed62ede 100644 (file)
@@ -1,11 +1,11 @@
 #ifndef SEQUENCER_H
 #define SEQUENCER_H
 
-#include "cache.h"
 #include "strbuf.h"
 #include "wt-status.h"
 
 struct commit;
+struct index_state;
 struct repository;
 
 const char *git_path_commit_editmsg(void);
index 4301a7eef274bb7796ad758d686f61b7c5b35395..3750794afe90c8c7d7951cdd187945c895115781 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef XDIFF_INTERFACE_H
 #define XDIFF_INTERFACE_H
 
-#include "cache.h"
+#include "hash.h"
 #include "xdiff/xdiff.h"
 
 /*