summaryrefslogtreecommitdiff
path: root/packfile.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2021-01-13 22:24:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-14 05:53:46 (GMT)
commit45bef5c064e4a41c07b1ddedd7c238c1c55ae182 (patch)
treefa19b8aa043b0bfe14d9de87e2d9c210e1d84845 /packfile.c
parent78232bf65d59601fad99b4f45a90effaf0ac1204 (diff)
downloadgit-45bef5c064e4a41c07b1ddedd7c238c1c55ae182.zip
git-45bef5c064e4a41c07b1ddedd7c238c1c55ae182.tar.gz
git-45bef5c064e4a41c07b1ddedd7c238c1c55ae182.tar.bz2
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 <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r--packfile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/packfile.c b/packfile.c
index 86f5c8d..3e3f391 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1235,18 +1235,18 @@ static int get_delta_base_oid(struct packed_git *p,
oidread(oid, base);
return 0;
} else if (type == OBJ_OFS_DELTA) {
- struct revindex_entry *revidx;
+ uint32_t base_pos;
off_t base_offset = get_delta_base(p, w_curs, &curpos,
type, delta_obj_offset);
if (!base_offset)
return -1;
- revidx = find_pack_revindex(p, base_offset);
- if (!revidx)
+ if (offset_to_pack_pos(p, base_offset, &base_pos) < 0)
return -1;
- return nth_packed_object_id(oid, p, revidx->nr);
+ return nth_packed_object_id(oid, p,
+ pack_pos_to_index(p, base_pos));
} else
return -1;
}