diff options
| author | Elijah Newren <newren@gmail.com> | 2023-02-24 00:09:30 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-02-23 17:25:29 -0800 |
| commit | a64215b6cd5e67939187475c5b248dc5d13e3d60 (patch) | |
| tree | d94a55def948e5f8c1c05cef23e7fb69b4ffa198 /cache.h | |
| parent | b5fa608180d4270b3495258ab098426551a18372 (diff) | |
| download | git-a64215b6cd5e67939187475c5b248dc5d13e3d60.tar.gz | |
object.h: stop depending on cache.h; make cache.h depend on object.h
Things should be able to depend on object.h without pulling in all of
cache.h. Move an enum to allow this.
Note that a couple files previously depended on things brought in
through cache.h indirectly (revision.h -> commit.h -> object.h ->
cache.h). As such, this change requires making existing dependencies
more explicit in half a dozen files. The inclusion of strbuf.h in
some headers if of particular note: these headers directly embedded a
strbuf in some new structs, meaning they should have been including
strbuf.h all along but were indirectly getting the necessary
definitions.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
| -rw-r--r-- | cache.h | 21 |
1 files changed, 1 insertions, 20 deletions
@@ -14,6 +14,7 @@ #include "pack-revindex.h" #include "hash.h" #include "path.h" +#include "object.h" #include "oid-array.h" #include "repository.h" #include "mem-pool.h" @@ -453,26 +454,6 @@ void prefetch_cache_entries(const struct index_state *istate, extern struct index_state the_index; #endif -#define TYPE_BITS 3 - -/* - * Values in this enum (except those outside the 3 bit range) are part - * of pack file format. See gitformat-pack(5) for more information. - */ -enum object_type { - OBJ_BAD = -1, - OBJ_NONE = 0, - OBJ_COMMIT = 1, - OBJ_TREE = 2, - OBJ_BLOB = 3, - OBJ_TAG = 4, - /* 5 for future expansion */ - OBJ_OFS_DELTA = 6, - OBJ_REF_DELTA = 7, - OBJ_ANY, - OBJ_MAX -}; - static inline enum object_type object_type(unsigned int mode) { return S_ISDIR(mode) ? OBJ_TREE : |
