aboutsummaryrefslogtreecommitdiffstats
path: root/odb/streaming.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 /odb/streaming.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 'odb/streaming.c')
-rw-r--r--odb/streaming.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/odb/streaming.c b/odb/streaming.c
index 7ef58adaa2..745cd486fb 100644
--- a/odb/streaming.c
+++ b/odb/streaming.c
@@ -214,8 +214,6 @@ ssize_t odb_read_stream_read(struct odb_read_stream *st, void *buf, size_t sz)
struct odb_read_stream *odb_read_stream_open(struct object_database *odb,
const struct object_id *oid,
- enum object_type *type,
- unsigned long *size,
struct stream_filter *filter)
{
struct odb_read_stream *st;
@@ -235,8 +233,6 @@ struct odb_read_stream *odb_read_stream_open(struct object_database *odb,
st = nst;
}
- *size = st->size;
- *type = st->type;
return st;
}
@@ -247,18 +243,16 @@ int odb_stream_blob_to_fd(struct object_database *odb,
int can_seek)
{
struct odb_read_stream *st;
- enum object_type type;
- unsigned long sz;
ssize_t kept = 0;
int result = -1;
- st = odb_read_stream_open(odb, oid, &type, &sz, filter);
+ st = odb_read_stream_open(odb, oid, filter);
if (!st) {
if (filter)
free_stream_filter(filter);
return result;
}
- if (type != OBJ_BLOB)
+ if (st->type != OBJ_BLOB)
goto close_and_exit;
for (;;) {
char buf[1024 * 16];