From e7e952f5c27bbca3d98bbcea6d20cd5b63d7d8e5 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 17 Jul 2025 06:56:36 +0200 Subject: object-file: get rid of `the_repository` when writing objects The logic that writes loose objects still relies on `the_repository` to decide where exactly the object shall be written to. Refactor it so that the logic instead operates on a `struct odb_source` so that we can get rid of this global dependency. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- builtin/unpack-objects.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'builtin') diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c index 1a4fbef36f..1d405d156e 100644 --- a/builtin/unpack-objects.c +++ b/builtin/unpack-objects.c @@ -403,7 +403,8 @@ static void stream_blob(unsigned long size, unsigned nr) data.zstream = &zstream; git_inflate_init(&zstream); - if (stream_loose_object(&in_stream, size, &info->oid)) + if (stream_loose_object(the_repository->objects->sources, + &in_stream, size, &info->oid)) die(_("failed to write object in stream")); if (data.status != Z_STREAM_END) -- cgit v1.3