Thread (94 messages) 94 messages, 4 authors, 2021-01-14

Re: [PATCH 03/20] write_reused_pack_one(): convert to new revindex API

flat view

From: Jeff King <hidden>
Date: 2021-01-12 08:50:48

On Fri, Jan 08, 2021 at 01:16:53PM -0500, Taylor Blau wrote:
quoted hunk ↗ jump to hunk
-	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.
quoted hunk ↗ jump to hunk
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help