aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile/packfile.go
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing/format/packfile/packfile.go')
-rw-r--r--plumbing/format/packfile/packfile.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/plumbing/format/packfile/packfile.go b/plumbing/format/packfile/packfile.go
index a9121c4..52eb338 100644
--- a/plumbing/format/packfile/packfile.go
+++ b/plumbing/format/packfile/packfile.go
@@ -489,14 +489,12 @@ func (i *objectIter) Next() (plumbing.EncodedObject, error) {
if typ != i.typ {
continue
}
- } else {
- if obj, ok := i.p.cacheGet(e.Hash); ok {
- if obj.Type() != i.typ {
- continue
- }
- return obj, nil
+ } else if obj, ok := i.p.cacheGet(e.Hash); ok {
+ if obj.Type() != i.typ {
+ continue
}
-
+ return obj, nil
+ } else {
h, err := i.p.objectHeaderAtOffset(int64(e.Offset))
if err != nil {
return nil, err