Skip to content

Commit 3a3f54d

Browse files
ttaylorrgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 45bef5c commit 3a3f54d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packfile.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,12 +1256,11 @@ static int retry_bad_packed_offset(struct repository *r,
12561256
off_t obj_offset)
12571257
{
12581258
int type;
1259-
struct revindex_entry *revidx;
1259+
uint32_t pos;
12601260
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)
12631262
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));
12651264
mark_bad_packed_object(p, oid.hash);
12661265
type = oid_object_info(r, &oid, NULL);
12671266
if (type <= OBJ_NONE)

0 commit comments

Comments
 (0)