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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
ab1c6e1d12
commit
e7e952f5c2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user