summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-10-01 09:16:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-10-01 22:06:00 (GMT)
commitddb3474b66ef36da40a4cf8346ec4655518243cb (patch)
treea5481b3cc606b3dd23728f6d9b476fade19d3adb /cache.h
parentbfff2c48330e95244a0ebdd7e0ba82fb77327347 (diff)
downloadgit-ddb3474b66ef36da40a4cf8346ec4655518243cb.zip
git-ddb3474b66ef36da40a4cf8346ec4655518243cb.tar.gz
git-ddb3474b66ef36da40a4cf8346ec4655518243cb.tar.bz2
object-file.c: make parse_loose_header_extended() public
Make the parse_loose_header_extended() function public and remove the parse_loose_header() wrapper. The only direct user of it outside of object-file.c itself was in streaming.c, that caller can simply pass the required "struct object-info *" instead. This change is being done in preparation for teaching read_loose_object() to accept a flag to pass to parse_loose_header(). It isn't strictly necessary for that change, we could simply use parse_loose_header_extended() there, but will leave the API in a better end state. It would be a better end-state to have already moved the declaration of these functions to object-store.h to avoid the forward declaration of "struct object_info" in cache.h, but let's leave that cleanup for some other time. 1. https://lore.kernel.org/git/patch-v6-09.22-5b9278e7bb4-20210907T104559Z-avarab@gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/cache.h b/cache.h
index ba04ff8..985cace 100644
--- a/cache.h
+++ b/cache.h
@@ -1303,7 +1303,9 @@ char *xdg_cache_home(const char *filename);
int git_open_cloexec(const char *name, int flags);
#define git_open(name) git_open_cloexec(name, O_RDONLY)
int unpack_loose_header(git_zstream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz);
-int parse_loose_header(const char *hdr, unsigned long *sizep);
+struct object_info;
+int parse_loose_header(const char *hdr, struct object_info *oi,
+ unsigned int flags);
int check_object_signature(struct repository *r, const struct object_id *oid,
void *buf, unsigned long size, const char *type);