aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing')
-rw-r--r--plumbing/format/packfile/packfile.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/plumbing/format/packfile/packfile.go b/plumbing/format/packfile/packfile.go
index a8f3d2b..def6e99 100644
--- a/plumbing/format/packfile/packfile.go
+++ b/plumbing/format/packfile/packfile.go
@@ -478,6 +478,7 @@ func (i *objectIter) Next() (plumbing.EncodedObject, error) {
}
} else if obj, ok := i.p.cacheGet(e.Hash); ok {
if obj.Type() != i.typ {
+ i.p.offsetToType[int64(e.Offset)] = obj.Type()
continue
}
return obj, nil
@@ -493,12 +494,14 @@ func (i *objectIter) Next() (plumbing.EncodedObject, error) {
return nil, err
}
if typ != i.typ {
+ i.p.offsetToType[int64(e.Offset)] = typ
continue
}
// getObjectType will seek in the file so we cannot use getNextObject safely
return i.p.objectAtOffset(int64(e.Offset), e.Hash)
} else {
if h.Type != i.typ {
+ i.p.offsetToType[int64(e.Offset)] = h.Type
continue
}
return i.p.getNextObject(h, e.Hash)