diff options
author | Javi Fontan <jfontan@gmail.com> | 2018-07-26 13:42:51 +0200 |
---|---|---|
committer | Javi Fontan <jfontan@gmail.com> | 2018-07-26 14:17:56 +0200 |
commit | 79f249465b24104b73c9dc220d9098cecdab4d77 (patch) | |
tree | 8804820221e05096433b2e0cef5249e4a3e94c7b /plumbing/format/packfile/decoder.go | |
parent | 74f56f388bbe8072bfcd976add2373f9a7e20341 (diff) | |
download | go-git-79f249465b24104b73c9dc220d9098cecdab4d77.tar.gz |
plumbing, storage: integrate new index
Now dotgit.PackWriter uses the new packfile.Parser and index.
Signed-off-by: Javi Fontan <jfontan@gmail.com>
Diffstat (limited to 'plumbing/format/packfile/decoder.go')
-rw-r--r-- | plumbing/format/packfile/decoder.go | 9 |
1 files changed, 5 insertions, 4 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) { |