aboutsummaryrefslogtreecommitdiff
path: root/packfile.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-12-15 17:40:31 +0900
committerJunio C Hamano <gitster@pobox.com>2025-12-15 17:40:31 +0900
commitf1799202ea040798dbff1e6a6ad51fa2e7c6858c (patch)
tree0def4e76638eff5ca5628d3cb2d0acb157c7bf37 /packfile.h
parentd8af7cadaa79d5837d73ec949e10b57dedb43e9b (diff)
parent7b940286527ec2175dffbb317f47e080bb37cf3e (diff)
downloadgit-f1799202ea040798dbff1e6a6ad51fa2e7c6858c.tar.xz
Merge branch 'ps/object-read-stream' into ps/packfile-store-in-odb-source
* ps/object-read-stream: streaming: drop redundant type and size pointers streaming: move into object database subsystem streaming: refactor interface to be object-database-centric streaming: move logic to read packed objects streams into backend streaming: move logic to read loose objects streams into backend streaming: make the `odb_read_stream` definition public streaming: get rid of `the_repository` streaming: rely on object sources to create object stream packfile: introduce function to read object info from a store streaming: move zlib stream into backends streaming: create structure for filtered object streams streaming: create structure for packed object streams streaming: create structure for loose object streams streaming: create structure for in-core object streams streaming: allocate stream inside the backend-specific logic streaming: explicitly pass packfile info when streaming a packed object streaming: propagate final object type via the stream streaming: drop the `open()` callback function streaming: rename `git_istream` into `odb_read_stream`
Diffstat (limited to 'packfile.h')
-rw-r--r--packfile.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/packfile.h b/packfile.h
index 20e1cf17b2..59d162a3f4 100644
--- a/packfile.h
+++ b/packfile.h
@@ -9,6 +9,7 @@
/* in odb.h */
struct object_info;
+struct odb_read_stream;
struct packed_git {
struct pack_window *windows;
@@ -177,6 +178,21 @@ void packfile_store_add_pack(struct packfile_store *store,
for (struct packfile_list_entry *e = packfile_store_get_packs(repo->objects->packfiles); \
((p) = (e ? e->pack : NULL)); e = e->next)
+int packfile_store_read_object_stream(struct odb_read_stream **out,
+ struct packfile_store *store,
+ const struct object_id *oid);
+
+/*
+ * Try to read the object identified by its ID from the object store and
+ * populate the object info with its data. Returns 1 in case the object was
+ * not found, 0 if it was and read successfully, and a negative error code in
+ * case the object was corrupted.
+ */
+int packfile_store_read_object_info(struct packfile_store *store,
+ const struct object_id *oid,
+ struct object_info *oi,
+ unsigned flags);
+
/*
* Get all packs managed by the given store, including packfiles that are
* referenced by multi-pack indices.
@@ -376,7 +392,6 @@ const struct packed_git *has_packed_and_bad(struct repository *, const struct ob
* Iff a pack file in the given repository contains the object named by sha1,
* return true and store its location to e.
*/
-int find_pack_entry(struct repository *r, const struct object_id *oid, struct pack_entry *e);
int find_kept_pack_entry(struct repository *r, const struct object_id *oid, unsigned flags, struct pack_entry *e);
int has_object_pack(struct repository *r, const struct object_id *oid);