summaryrefslogtreecommitdiff
path: root/packfile.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2021-01-13 22:24:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-14 05:53:47 (GMT)
commit3a3f54dd0a70c2b6e8342b156d13e0bd941be07b (patch)
tree8db9ae44f1471ec090e3496622f554fc60238a89 /packfile.c
parent45bef5c064e4a41c07b1ddedd7c238c1c55ae182 (diff)
downloadgit-3a3f54dd0a70c2b6e8342b156d13e0bd941be07b.zip
git-3a3f54dd0a70c2b6e8342b156d13e0bd941be07b.tar.gz
git-3a3f54dd0a70c2b6e8342b156d13e0bd941be07b.tar.bz2
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 <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r--packfile.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/packfile.c b/packfile.c
index 3e3f391..7c37f9e 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1256,12 +1256,11 @@ static int retry_bad_packed_offset(struct repository *r,
off_t obj_offset)
{
int type;
- struct revindex_entry *revidx;
+ uint32_t pos;
struct object_id oid;
- revidx = find_pack_revindex(p, obj_offset);
- if (!revidx)
+ if (offset_to_pack_pos(p, obj_offset, &pos) < 0)
return OBJ_BAD;
- nth_packed_object_id(&oid, p, revidx->nr);
+ nth_packed_object_id(&oid, p, pack_pos_to_index(p, pos));
mark_bad_packed_object(p, oid.hash);
type = oid_object_info(r, &oid, NULL);
if (type <= OBJ_NONE)