Skip to content

Commit 45bef5c

Browse files
ttaylorrgitster
authored andcommitted
get_delta_base_oid(): convert to new revindex API
Replace direct accesses to the 'struct revindex' type with a call to 'pack_pos_to_index()'. Likewise drop the old-style 'find_pack_revindex()' with its replacement 'offset_to_pack_pos()' (while continuing to perform the same error checking). Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 78232bf commit 45bef5c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packfile.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,18 +1235,18 @@ static int get_delta_base_oid(struct packed_git *p,
12351235
oidread(oid, base);
12361236
return 0;
12371237
} else if (type == OBJ_OFS_DELTA) {
1238-
struct revindex_entry *revidx;
1238+
uint32_t base_pos;
12391239
off_t base_offset = get_delta_base(p, w_curs, &curpos,
12401240
type, delta_obj_offset);
12411241

12421242
if (!base_offset)
12431243
return -1;
12441244

1245-
revidx = find_pack_revindex(p, base_offset);
1246-
if (!revidx)
1245+
if (offset_to_pack_pos(p, base_offset, &base_pos) < 0)
12471246
return -1;
12481247

1249-
return nth_packed_object_id(oid, p, revidx->nr);
1248+
return nth_packed_object_id(oid, p,
1249+
pack_pos_to_index(p, base_pos));
12501250
} else
12511251
return -1;
12521252
}

0 commit comments

Comments
 (0)