aboutsummaryrefslogtreecommitdiff
path: root/object-file.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-02-23 17:00:07 +0100
committerJunio C Hamano <gitster@pobox.com>2026-02-23 13:19:00 -0800
commit10a6762719f612bb5edc554e62239a744bbc4283 (patch)
tree636c24ae79ac9cc79659095361dc308f411895d4 /object-file.h
parent26fc7b59cd00ee4042494b0a01afbda62c9d5b1a (diff)
downloadgit-10a6762719f612bb5edc554e62239a744bbc4283.tar.xz
object-file: adapt `stream_object_signature()` to take a stream
The function `stream_object_signature()` is responsible for verifying whether the given object ID matches the actual hash of the object's contents. In contrast to `check_object_signature()` it does so in a streaming fashion so that we don't have to load the full object into memory. In a subsequent commit we'll want to adapt one of its callsites to pass a preconstructed stream. Prepare for this by accepting a stream as input that the caller needs to assemble. While at it, improve the error reporting in `parse_object_with_flags()` to tell apart the two failure modes. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-file.h')
-rw-r--r--object-file.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/object-file.h b/object-file.h
index 1229d5f675..6936fd0fef 100644
--- a/object-file.h
+++ b/object-file.h
@@ -164,7 +164,9 @@ int check_object_signature(struct repository *r, const struct object_id *oid,
* Try reading the object named with "oid" using
* the streaming interface and rehash it to do the same.
*/
-int stream_object_signature(struct repository *r, const struct object_id *oid);
+int stream_object_signature(struct repository *r,
+ struct odb_read_stream *stream,
+ const struct object_id *oid);
enum finalize_object_file_flags {
FOF_SKIP_COLLISION_CHECK = 1,