Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit f25873b

Browse files
committed
Populate the offsetToType cache in the iterator even for the skipped objects
Signed-off-by: Filip Navara <[email protected]>
1 parent b0e21ee commit f25873b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

plumbing/format/packfile/packfile.go

+2
Original file line numberDiff line numberDiff line change
@@ -493,12 +493,14 @@ func (i *objectIter) Next() (plumbing.EncodedObject, error) {
493493
return nil, err
494494
}
495495
if typ != i.typ {
496+
i.p.offsetToType[int64(e.Offset)] = typ
496497
continue
497498
}
498499
// getObjectType will seek in the file so we cannot use getNextObject safely
499500
return i.p.objectAtOffset(int64(e.Offset), e.Hash)
500501
} else {
501502
if h.Type != i.typ {
503+
i.p.offsetToType[int64(e.Offset)] = h.Type
502504
continue
503505
}
504506
return i.p.getNextObject(h, e.Hash)

0 commit comments

Comments
 (0)