diff options
| author | Elijah Newren <newren@gmail.com> | 2023-04-11 00:42:03 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-04-11 08:52:11 -0700 |
| commit | b7b189cd5ae99f336c1185f8f8c27a118314ced1 (patch) | |
| tree | 44451900fafab2dc2233a33a1ee6eb174f8c619e | |
| parent | treewide: remove double forward declaration of read_in_full (diff) | |
| download | git-b7b189cd5ae99f336c1185f8f8c27a118314ced1.tar.gz git-b7b189cd5ae99f336c1185f8f8c27a118314ced1.zip | |
treewide: reduce includes of cache.h in other headers
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>
| -rw-r--r-- | archive.h | 2 | ||||
| -rw-r--r-- | chdir-notify.c | 3 | ||||
| -rw-r--r-- | quote.c | 3 | ||||
| -rw-r--r-- | refs/ref-cache.h | 2 | ||||
| -rw-r--r-- | rerere.c | 2 | ||||
| -rw-r--r-- | resolve-undo.h | 7 | ||||
| -rw-r--r-- | revision.c | 2 | ||||
| -rw-r--r-- | split-index.h | 2 |
8 files changed, 15 insertions, 8 deletions
@@ -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; diff --git a/chdir-notify.c b/chdir-notify.c index 8e38cd6f3a..0d7bc04607 100644 --- a/chdir-notify.c +++ b/chdir-notify.c @@ -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" @@ -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" diff --git a/refs/ref-cache.h b/refs/ref-cache.h index 850d9d3744..cf4ad9070b 100644 --- a/refs/ref-cache.h +++ b/refs/ref-cache.h @@ -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; @@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "abspath.h" #include "alloc.h" #include "config.h" diff --git a/resolve-undo.h b/resolve-undo.h index 2b3f0f901e..d1ea972771 100644 --- a/resolve-undo.h +++ b/resolve-undo.h @@ -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]; diff --git a/revision.c b/revision.c index 3d86e07abb..43f88eaf56 100644 --- a/revision.c +++ b/revision.c @@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "config.h" #include "environment.h" diff --git a/split-index.h b/split-index.h index 7a435ca2c9..1a153f47ba 100644 --- a/split-index.h +++ b/split-index.h @@ -1,7 +1,7 @@ #ifndef SPLIT_INDEX_H #define SPLIT_INDEX_H -#include "cache.h" +#include "hash.h" struct index_state; struct strbuf; |
