aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-11-23 19:59:44 +0100
committerJunio C Hamano <gitster@pobox.com>2025-11-23 12:56:46 -0800
commit7b940286527ec2175dffbb317f47e080bb37cf3e (patch)
tree2d5b17c348d3f01a3b35bf3e2e33943586b1c39e /builtin/pack-objects.c
parent1599b68d5e960a12f5ac624f81c70ece317db5a6 (diff)
downloadgit-7b940286527ec2175dffbb317f47e080bb37cf3e.tar.gz
streaming: drop redundant type and size pointers
In the preceding commits we have turned `struct odb_read_stream` into a publicly visible structure. Furthermore, this structure now contains the type and size of the object that we are about to stream. Consequently, the out-pointers that we used before to propagate the type and size of the streamed object are now somewhat redundant with the data contained in the structure itself. Drop these out-pointers and adapt callers accordingly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index f109e26786..0d1d6995bf 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -521,9 +521,11 @@ static unsigned long write_no_reuse_object(struct hashfile *f, struct object_ent
oe_size_greater_than(&to_pack, entry,
repo_settings_get_big_file_threshold(the_repository)) &&
(st = odb_read_stream_open(the_repository->objects, &entry->idx.oid,
- &type, &size, NULL)) != NULL)
+ NULL)) != NULL) {
buf = NULL;
- else {
+ type = st->type;
+ size = st->size;
+ } else {
buf = odb_read_object(the_repository->objects,
&entry->idx.oid, &type,
&size);