aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/packfile')
-rw-r--r--plumbing/format/packfile/packfile.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/plumbing/format/packfile/packfile.go b/plumbing/format/packfile/packfile.go
index 52eb338..0dd9730 100644
--- a/plumbing/format/packfile/packfile.go
+++ b/plumbing/format/packfile/packfile.go
@@ -500,15 +500,19 @@ func (i *objectIter) Next() (plumbing.EncodedObject, error) {
return nil, err
}
- typ, err := i.p.getObjectType(h)
- if err != nil {
- return nil, err
- }
- if typ != i.typ {
- continue
+ if h.Type == plumbing.REFDeltaObject || h.Type == plumbing.OFSDeltaObject {
+ obj, err := i.p.getNextObject(h, e.Hash)
+ if err != nil {
+ return nil, err
+ }
+ if obj.Type() == i.typ {
+ return obj, nil
+ }
+ } else if h.Type == i.typ {
+ return i.p.getNextObject(h, e.Hash)
}
- return i.p.getNextObject(h, e.Hash)
+ continue
}
}