retry_bad_packed_offset(): convert to new revindex API
Perform exactly the same conversion as in the previous commit to another caller within 'packfile.c'. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau committed
Jan 13, 2021 at 17:24 UTC
3a3f54dd0a70c2b6e8342b156d13e0bd941be07b
1 file changed
+3
-4
packfile.c
+3
-4
@@ -1256,12 +1256,11 @@ static int retry_bad_packed_offset(struct repository *r,
1256
off_t obj_offset)
1257
{
1258
int type;
1259
- struct revindex_entry *revidx;
1259
+ uint32_t pos;
1260
struct object_id oid;
1261
- revidx = find_pack_revindex(p, obj_offset);
1262
- if (!revidx)
1261
+ if (offset_to_pack_pos(p, obj_offset, &pos) < 0)
1262
return OBJ_BAD;
1264
- nth_packed_object_id(&oid, p, revidx->nr);
1263
+ nth_packed_object_id(&oid, p, pack_pos_to_index(p, pos));
1264
mark_bad_packed_object(p, oid.hash);
1265
type = oid_object_info(r, &oid, NULL);
1266
if (type <= OBJ_NONE)