]> git.ipfire.org Git - thirdparty/git.git/commitdiff
treewide: reduce includes of cache.h in other headers
authorElijah Newren <newren@gmail.com>
Tue, 11 Apr 2023 07:42:03 +0000 (00:42 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Apr 2023 15:52:11 +0000 (08:52 -0700)
We had a handful of headers including cache.h that didn't need to
anymore.  Drop those includes and replace them with includes of
smaller files, or forward declarations.  However, note that two .c
files now need to directly include cache.h, though they should have
been including it all along given they are directly using structs
defined in it.

Signed-off-by: Elijah Newren <newren@gmail.com>
Acked-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
archive.h
chdir-notify.c
quote.c
refs/ref-cache.h
rerere.c
resolve-undo.h
revision.c
split-index.h

index f96839ef383c468e6f2182a461f4ad01c2b5a6e5..3a4bdfbd078109680dd54143d03ee2567a0cba31 100644 (file)
--- a/archive.h
+++ b/archive.h
@@ -1,9 +1,9 @@
 #ifndef ARCHIVE_H
 #define ARCHIVE_H
 
-#include "cache.h"
 #include "object-name.h"
 #include "pathspec.h"
+#include "string-list.h"
 
 struct repository;
 struct pretty_print_context;
index 8e38cd6f3aea9c456f809a6fdf51b10eefaaa925..0d7bc0460747b2973f913b746c4b9ef0ba6b9028 100644 (file)
@@ -1,7 +1,8 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "chdir-notify.h"
 #include "list.h"
+#include "path.h"
 #include "strbuf.h"
 #include "trace.h"
 
diff --git a/quote.c b/quote.c
index 7ccb5a06cd161c46ad2deeacc19de7bec99731a2..43c739671ed0cb33cd246a98737136b2154c2a57 100644 (file)
--- a/quote.c
+++ b/quote.c
@@ -1,5 +1,6 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "alloc.h"
+#include "path.h"
 #include "quote.h"
 #include "strbuf.h"
 #include "strvec.h"
index 850d9d3744e94270fb5cd445b4f6b7b18aac8128..cf4ad9070b9c323a94826841a5404329e1d4a071 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef REFS_REF_CACHE_H
 #define REFS_REF_CACHE_H
 
-#include "cache.h"
+#include "hash.h"
 
 struct ref_dir;
 struct ref_store;
index 093c0f6f99319e32dc5d6eb6526fa31a7b07d7f7..7abc94bf444dc18fe0eb4d170845bf54c9a7370e 100644 (file)
--- a/rerere.c
+++ b/rerere.c
@@ -1,4 +1,4 @@
-#include "git-compat-util.h"
+#include "cache.h"
 #include "abspath.h"
 #include "alloc.h"
 #include "config.h"
index 2b3f0f901e63aeab70dfca86d3067d169dc315e2..d1ea97277127f20c7a5f1dbb5c68fc6d7f2af3de 100644 (file)
@@ -1,7 +1,12 @@
 #ifndef RESOLVE_UNDO_H
 #define RESOLVE_UNDO_H
 
-#include "cache.h"
+struct cache_entry;
+struct index_state;
+struct pathspec;
+struct string_list;
+
+#include "hash.h"
 
 struct resolve_undo_info {
        unsigned int mode[3];
index 3d86e07abb8ab911e2572ceeb5390749ec46e083..43f88eaf56c4dcd23477ef5bdb80ab428c8f70fa 100644 (file)
@@ -1,4 +1,4 @@
-#include "git-compat-util.h"
+#include "cache.h"
 #include "alloc.h"
 #include "config.h"
 #include "environment.h"
index 7a435ca2c970111b40ac9edba65726e79bd7941d..1a153f47ba348fb3e8c5bdcae9b279cef352f475 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SPLIT_INDEX_H
 #define SPLIT_INDEX_H
 
-#include "cache.h"
+#include "hash.h"
 
 struct index_state;
 struct strbuf;