]> git.ipfire.org Git - thirdparty/git.git/commit - pack-bitmap.c
try_partial_reuse(): convert to new revindex API
authorTaylor Blau <me@ttaylorr.com>
Wed, 13 Jan 2021 22:24:05 +0000 (17:24 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Jan 2021 05:53:46 +0000 (21:53 -0800)
commit011f3fd5cdacc69e2ba2adf998656adcd2045a0f
tree7be41875517928c075b977c08ab6e3039daea23d
parenta78a90324d1c5ccba2ab46cb70573518dd6eeade
try_partial_reuse(): convert to new revindex API

Remove another instance of direct revindex manipulation by calling
'pack_pos_to_offset()' instead (the caller here does not care about the
index position of the object at position 'pos').

Note that we cannot just use the existing "offset" variable to store the
value we get from pack_pos_to_offset(). It is incremented by
unpack_object_header(), but we later need the original value. Since
we'll no longer have revindex->offset to read it from, we'll store that
in a separate variable ("header" since it points to the entry's header
bytes).

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap.c