pack-objects: use object_id struct in pack-reuse code
commitf66d4e025059b734ba8da40ec059bb0fb8991306
authorJeff King <peff@peff.net>
Mon, 24 Feb 2020 04:31:22 +0000 (23 23:31 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Feb 2020 20:55:53 +0000 (24 12:55 -0800)
tree36f77546d1f75d193f8f067024720675b4e5e8e9
parenta93c141ddef25dc999fff73c590b42d3af606ff3
pack-objects: use object_id struct in pack-reuse code

When the pack-reuse code is dumping an OFS_DELTA entry to a client that
doesn't support it, we re-write it as a REF_DELTA. To do so, we use
nth_packed_object_sha1() to get the oid, but that function is soon going
away in favor of the more type-safe nth_packed_object_id(). Let's switch
now in preparation.

Note that this does incur an extra hash copy (from the pack idx mmap to
the object_id and then to the output, rather than straight from mmap to
the output). But this is not worth worrying about. It's probably not
measurable even when it triggers, and this is fallback code that we
expect to trigger very rarely (since everybody supports OFS_DELTA these
days anyway).

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