check_object(): convert to new revindex API
commiteb3fd99efd82bc8d199e01634e6fb521d3a27641
authorTaylor Blau <me@ttaylorr.com>
Wed, 13 Jan 2021 22:23:47 +0000 (13 17:23 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Jan 2021 05:53:45 +0000 (13 21:53 -0800)
tree49c56e4f055adb8b7df3cb1650c1f731871e46db
parent6a5c10c45f110abfef89c978cd8d5f7120f63d48
check_object(): convert to new revindex API

Replace direct accesses to the revindex with calls to
'offset_to_pack_pos()' and 'pack_pos_to_index()'.

Since this caller already had some error checking (it can jump to the
'give_up' label if it encounters an error), we can easily check whether
or not the provided offset points to an object in the given pack. This
error checking existed prior to this patch, too, since the caller checks
whether the return value from 'find_pack_revindex()' was NULL or not.

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