aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing')
-rw-r--r--plumbing/format/packfile/decoder.go9
-rw-r--r--plumbing/format/packfile/parser.go11
2 files changed, 11 insertions, 9 deletions
diff --git a/plumbing/format/packfile/decoder.go b/plumbing/format/packfile/decoder.go
index 9bfd69b..69aef2d 100644
--- a/plumbing/format/packfile/decoder.go
+++ b/plumbing/format/packfile/decoder.go
@@ -447,11 +447,12 @@ func (d *Decoder) recallByOffset(o int64) (plumbing.EncodedObject, error) {
return d.DecodeObjectAt(o)
}
- // if e, ok := d.idx.LookupOffset(uint64(o)); ok {
- // return d.recallByHashNonSeekable(e.Hash)
- // }
+ hash, err := d.idx.FindHash(o)
+ if err != nil {
+ return nil, err
+ }
- return nil, plumbing.ErrObjectNotFound
+ return d.recallByHashNonSeekable(hash)
}
func (d *Decoder) recallByHash(h plumbing.Hash) (plumbing.EncodedObject, error) {
diff --git a/plumbing/format/packfile/parser.go b/plumbing/format/packfile/parser.go
index 460fc3f..696f5ba 100644
--- a/plumbing/format/packfile/parser.go
+++ b/plumbing/format/packfile/parser.go
@@ -311,11 +311,12 @@ func applyPatchBase(ota *objectInfo, data, base []byte) ([]byte, error) {
type objectInfo struct {
plumbing.Hasher
- Offset int64
- Length int64
- PackSize int64
- Type plumbing.ObjectType
- DiskType plumbing.ObjectType
+ Offset int64
+ Length int64
+ HeaderLength int64
+ PackSize int64
+ Type plumbing.ObjectType
+ DiskType plumbing.ObjectType
Crc32 uint32