On Fri, Jan 08, 2021 at 01:16:53PM -0500, Taylor Blau wrote: > - offset = reuse_packfile->revindex[pos].offset; > - next = reuse_packfile->revindex[pos + 1].offset; > + offset = pack_pos_to_offset(reuse_packfile, pos); > + next = pack_pos_to_offset(reuse_packfile, pos + 1); Makes sense. > @@ -887,11 +887,15 @@ static void write_reused_pack_one(size_t pos, struct hashfile *out, > > /* Convert to REF_DELTA if we must... */ > if (!allow_ofs_delta) { > - int base_pos = find_revindex_position(reuse_packfile, base_offset); > + uint32_t base_pos; > struct object_id base_oid; > > + if (offset_to_pack_pos(reuse_packfile, base_offset, &base_pos) < 0) > + die(_("expected object at offset %"PRIuMAX), > + (uintmax_t)base_offset); This error does mention the offset, which is good. But not the pack name (nor the object name, but we don't have it!). -Peff