From 41b42e3527eb6b0ab4b557d16adedcd255c9045f Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Mon, 23 Feb 2026 17:00:08 +0100 Subject: packfile: expose function to read object stream for an offset The function `packfile_store_read_object_stream()` takes as input an object ID and then constructs a `struct odb_read_stream` from it. In a subsequent commit we'll want to create an object stream for a given combination of packfile and offset though, which is not something that can currently be done. Extract a new function `packfile_read_object_stream()` that makes this functionality available. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- packfile.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'packfile.h') diff --git a/packfile.h b/packfile.h index acc5c55ad5..b9f5f1c18c 100644 --- a/packfile.h +++ b/packfile.h @@ -436,6 +436,11 @@ off_t get_delta_base(struct packed_git *p, struct pack_window **w_curs, off_t *curpos, enum object_type type, off_t delta_obj_offset); +int packfile_read_object_stream(struct odb_read_stream **out, + const struct object_id *oid, + struct packed_git *pack, + off_t offset); + void release_pack_memory(size_t); /* global flag to enable extra checks when accessing packed objects */ -- cgit v1.3