]> git.feebdaed.xyz Git - 0xmirror/git.git/commit
streaming: explicitly pass packfile info when streaming a packed object
authorPatrick Steinhardt <ps@pks.im>
Sun, 23 Nov 2025 18:59:29 +0000 (19:59 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 23 Nov 2025 20:56:44 +0000 (12:56 -0800)
commit3c7722dd4d376e0fce4c48f723fe8b69af785998
tree98737219afad6f9efa2da4a5381a4e167e8f7e50
parent3f64deabdf0a2a9664acec61698affc449e07496
streaming: explicitly pass packfile info when streaming a packed object

When streaming a packed object we first populate the stream with
information about the pack that contains the object before calling
`open_istream_pack_non_delta()`. This is done because we have already
looked up both the pack and the object's offset, so it would be a waste
of time to look up this information again.

But the way this is done makes for a somewhat awkward calling interface,
as the caller now needs to be aware of how exactly the function itself
behaves.

Refactor the code so that we instead explicitly pass the packfile info
into `open_istream_pack_non_delta()`. This makes the calling convention
explicit, but more importantly this allows us to refactor the function
so that it becomes its responsibility to allocate the stream itself in a
subsequent patch.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
streaming.c