aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem
diff options
context:
space:
mode:
authorAntonio Navarro Perez <antnavper@gmail.com>2017-02-09 10:31:49 +0100
committerGitHub <noreply@github.com>2017-02-09 10:31:49 +0100
commit4f7ef8fe49e4824b741792bca6424b332b40421f (patch)
treeb6c1f2f47679f22db0b1ad6bf8fc745af3ec20b1 /storage/filesystem
parentb65d94e70ea1d013f43234522fa092168e4f1041 (diff)
parentb872b71112ed4034bbd9c33a0babd6353b582429 (diff)
downloadgo-git-4f7ef8fe49e4824b741792bca6424b332b40421f.tar.gz
Merge pull request #258 from ajnavarro/fix/onf-decoder
Fix missing objects if they where deltified using ref-delta
Diffstat (limited to 'storage/filesystem')
-rw-r--r--storage/filesystem/object.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/storage/filesystem/object.go b/storage/filesystem/object.go
index 2975c1e..904f6fe 100644
--- a/storage/filesystem/object.go
+++ b/storage/filesystem/object.go
@@ -233,7 +233,7 @@ func (s *ObjectStorage) buildPackfileIters(
return nil, err
}
- iter, err := newPackfileIter(pack, t, seen)
+ iter, err := newPackfileIter(pack, t, seen, s.index[h])
if err != nil {
return nil, err
}
@@ -272,10 +272,11 @@ type packfileIter struct {
}
func NewPackfileIter(f billy.File, t plumbing.ObjectType) (storer.EncodedObjectIter, error) {
- return newPackfileIter(f, t, make(map[plumbing.Hash]bool))
+ return newPackfileIter(f, t, make(map[plumbing.Hash]bool), nil)
}
-func newPackfileIter(f billy.File, t plumbing.ObjectType, seen map[plumbing.Hash]bool) (storer.EncodedObjectIter, error) {
+func newPackfileIter(f billy.File, t plumbing.ObjectType, seen map[plumbing.Hash]bool,
+ index idx) (storer.EncodedObjectIter, error) {
s := packfile.NewScanner(f)
_, total, err := s.Header()
if err != nil {
@@ -287,6 +288,8 @@ func newPackfileIter(f billy.File, t plumbing.ObjectType, seen map[plumbing.Hash
return nil, err
}
+ d.SetOffsets(index)
+
return &packfileIter{
f: f,
d: d,