aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile/decoder.go
diff options
context:
space:
mode:
authorJavi Fontan <jfontan@gmail.com>2018-07-19 23:25:14 +0200
committerJavi Fontan <jfontan@gmail.com>2018-07-26 14:17:56 +0200
commitce91d71f96097ede2bb77d2af444aee6fff73183 (patch)
tree2f25f357110b4ccc48442347cd6211e2c85873eb /plumbing/format/packfile/decoder.go
parentda5677f5ba3970d585d5955b15a6a1c3c262c07b (diff)
downloadgo-git-ce91d71f96097ede2bb77d2af444aee6fff73183.tar.gz
plumbing/packfile: disable lookup by offset
In one case it disables the cache and the other disables lookup when the scanner is not seekable. Could be added back later. Signed-off-by: Javi Fontan <jfontan@gmail.com>
Diffstat (limited to 'plumbing/format/packfile/decoder.go')
-rw-r--r--plumbing/format/packfile/decoder.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/plumbing/format/packfile/decoder.go b/plumbing/format/packfile/decoder.go
index 765401f..9bfd69b 100644
--- a/plumbing/format/packfile/decoder.go
+++ b/plumbing/format/packfile/decoder.go
@@ -403,12 +403,13 @@ func (d *Decoder) fillOFSDeltaObjectContent(obj plumbing.EncodedObject, offset i
return 0, err
}
- e, ok := d.idx.LookupOffset(uint64(offset))
- var base plumbing.EncodedObject
- if ok {
- base, ok = d.cacheGet(e.Hash)
- }
+ // e, ok := d.idx.LookupOffset(uint64(offset))
+ // if ok {
+ // base, ok = d.cacheGet(e.Hash)
+ // }
+ var base plumbing.EncodedObject
+ ok := false
if !ok {
base, err = d.recallByOffset(offset)
if err != nil {
@@ -446,9 +447,9 @@ 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)
- }
+ // if e, ok := d.idx.LookupOffset(uint64(o)); ok {
+ // return d.recallByHashNonSeekable(e.Hash)
+ // }
return nil, plumbing.ErrObjectNotFound
}