]> git.ipfire.org Git - thirdparty/git.git/commit - transport.c
transport: mark unused parameters in fetch_refs_from_bundle()
authorJeff King <peff@peff.net>
Fri, 17 Mar 2023 19:17:18 +0000 (15:17 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 Mar 2023 21:17:48 +0000 (14:17 -0700)
commitb3edf335dfa978b43d10de7e722a7e355a3d0e4c
tree9016da1a87b88bcf442c963b4cf81e9625e6991b
parent1e5e0974964170a917d6950dda74e82745ab65aa
transport: mark unused parameters in fetch_refs_from_bundle()

We don't look at the "to_fetch" or "nr_heads" parameters at all. At
first glance this seems like a bug (or at least pessimisation), because
it means we fetch more objects from the bundle than we actually need.
But the bundle does not have any way of computing the set of reachable
objects itself (we'd have to pull all of the objects out to walk them).
And anyway, we've probably already paid most of the cost of grabbing the
objects, since we must copy the bundle locally before accessing it.

So it's perfectly reasonable for the bundle code to just pull everything
into the local object store. Unneeded objects can be dropped later via
gc, etc.

But we should mark these unused parameters as such to avoid the wrath of
-Wunused-parameter.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport.c