aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/object.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-09-15 21:20:58 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-09-15 21:20:58 +0200
commit7e8d7125446bb6e12a056a5a6ca979727790d0df (patch)
treedf07bada01b332d00131c33034d88935357ba0d1 /storage/filesystem/object.go
parentd57f90b78eeb6b09b15e3fe57609ede66df4edac (diff)
downloadgo-git-7e8d7125446bb6e12a056a5a6ca979727790d0df.tar.gz
dotgit: synced write packfile and index generation
Diffstat (limited to 'storage/filesystem/object.go')
-rw-r--r--storage/filesystem/object.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/storage/filesystem/object.go b/storage/filesystem/object.go
index dc21d0b..03939ce 100644
--- a/storage/filesystem/object.go
+++ b/storage/filesystem/object.go
@@ -161,7 +161,11 @@ func (s *ObjectStorage) getFromPackfile(h core.Hash) (core.Object, error) {
defer f.Close()
p := packfile.NewScanner(f)
- d := packfile.NewDecoder(p, memory.NewStorage().ObjectStorage())
+ d, err := packfile.NewDecoder(p, memory.NewStorage().ObjectStorage())
+ if err != nil {
+ return nil, err
+ }
+
d.SetOffsets(s.index[pack])
return d.ReadObjectAt(offset)
}
@@ -285,7 +289,11 @@ func newPackfileIter(
return nil, err
}
- d := packfile.NewDecoder(s, memory.NewStorage().ObjectStorage())
+ d, err := packfile.NewDecoder(s, memory.NewStorage().ObjectStorage())
+ if err != nil {
+ return nil, err
+ }
+
return &packfileIter{f: f, d: d, t: t, total: total, seen: seen}, nil
}