diff options
author | Elijah Newren <newren@gmail.com> | 2023-04-22 22:17:20 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-24 21:47:32 +0200 |
commit | d1cbe1e6d8a9cab2b4ffe8a17d34db214dce1e49 (patch) | |
tree | 77bc199604bfda9597a2afbfce4dd121e7ba99db /tree-walk.h | |
parent | tree-diff.c: move S_DIFFTREE_IFXMIN_NEQ define from cache.h (diff) | |
download | git-d1cbe1e6d8a9cab2b4ffe8a17d34db214dce1e49.tar.xz git-d1cbe1e6d8a9cab2b4ffe8a17d34db214dce1e49.zip |
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 <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-walk.h')
-rw-r--r-- | tree-walk.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tree-walk.h b/tree-walk.h index 25fe27e352..01a9d8eb44 100644 --- a/tree-walk.h +++ b/tree-walk.h @@ -1,9 +1,10 @@ #ifndef TREE_WALK_H #define TREE_WALK_H -#include "hash.h" +#include "hash-ll.h" struct index_state; +struct repository; #define MAX_TRAVERSE_TREES 8 |