From d5fff46f4025e23ec61b9d74eac2bb19e7a2385d Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sat, 22 Apr 2023 20:17:12 +0000 Subject: copy.h: move declarations for copy.c functions from cache.h Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- refs/files-backend.c | 1 + 1 file changed, 1 insertion(+) (limited to 'refs') diff --git a/refs/files-backend.c b/refs/files-backend.c index d0581ee41a..1128a9af29 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -1,5 +1,6 @@ #include "../cache.h" #include "../config.h" +#include "../copy.h" #include "../environment.h" #include "../gettext.h" #include "../hex.h" -- cgit v1.2.3 From d1cbe1e6d8a9cab2b4ffe8a17d34db214dce1e49 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sat, 22 Apr 2023 20:17:20 +0000 Subject: hash-ll.h: split out of hash.h to remove dependency on repository.h hash.h depends upon and includes repository.h, due to the definition and use of the_hash_algo (defined as the_repository->hash_algo). However, most headers trying to include hash.h are only interested in the layout of the structs like object_id. Move the parts of hash.h that do not depend upon repository.h into a new file hash-ll.h (the "low level" parts of hash.h), and adjust other files to use this new header where the convenience inline functions aren't needed. This allows hash.h and object.h to be fairly small, minimal headers. It also exposes a lot of hidden dependencies on both path.h (which was brought in by repository.h) and repository.h (which was previously implicitly brought in by object.h), so also adjust other files to be more explicit about what they depend upon. Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- refs/files-backend.c | 1 + refs/packed-backend.c | 1 + refs/ref-cache.c | 2 ++ refs/ref-cache.h | 3 ++- 4 files changed, 6 insertions(+), 1 deletion(-) (limited to 'refs') diff --git a/refs/files-backend.c b/refs/files-backend.c index 1128a9af29..bca7b851c5 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -3,6 +3,7 @@ #include "../copy.h" #include "../environment.h" #include "../gettext.h" +#include "../hash.h" #include "../hex.h" #include "../refs.h" #include "refs-internal.h" diff --git a/refs/packed-backend.c b/refs/packed-backend.c index 2333ed5a1f..704424f55c 100644 --- a/refs/packed-backend.c +++ b/refs/packed-backend.c @@ -2,6 +2,7 @@ #include "../alloc.h" #include "../config.h" #include "../gettext.h" +#include "../hash.h" #include "../hex.h" #include "../refs.h" #include "refs-internal.h" diff --git a/refs/ref-cache.c b/refs/ref-cache.c index dc1ca49c85..2294c4564f 100644 --- a/refs/ref-cache.c +++ b/refs/ref-cache.c @@ -1,6 +1,8 @@ #include "../git-compat-util.h" #include "../alloc.h" +#include "../hash.h" #include "../refs.h" +#include "../repository.h" #include "refs-internal.h" #include "ref-cache.h" #include "../iterator.h" diff --git a/refs/ref-cache.h b/refs/ref-cache.h index cf4ad9070b..95c76e27c8 100644 --- a/refs/ref-cache.h +++ b/refs/ref-cache.h @@ -1,10 +1,11 @@ #ifndef REFS_REF_CACHE_H #define REFS_REF_CACHE_H -#include "hash.h" +#include "hash-ll.h" struct ref_dir; struct ref_store; +struct repository; /* * If this ref_cache is filled lazily, this function is used to load -- cgit v1.2.3 From d4a4f9291d63b48b368f79bce3151bee9ca28009 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Sat, 22 Apr 2023 20:17:26 +0000 Subject: commit.h: reduce unnecessary includes Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- refs/debug.c | 1 + 1 file changed, 1 insertion(+) (limited to 'refs') diff --git a/refs/debug.c b/refs/debug.c index adc34c836f..6f11e6de46 100644 --- a/refs/debug.c +++ b/refs/debug.c @@ -1,6 +1,7 @@ #include "git-compat-util.h" #include "hex.h" #include "refs-internal.h" +#include "string-list.h" #include "trace.h" static struct trace_key trace_refs = TRACE_KEY_INIT(REFS); -- cgit v1.2.3