aboutsummaryrefslogtreecommitdiffstats
path: root/storage/seekable/storage.go
diff options
context:
space:
mode:
Diffstat (limited to 'storage/seekable/storage.go')
-rw-r--r--storage/seekable/storage.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/storage/seekable/storage.go b/storage/seekable/storage.go
index 9cc37ba..e056c54 100644
--- a/storage/seekable/storage.go
+++ b/storage/seekable/storage.go
@@ -90,6 +90,10 @@ func buildIndexFromIdxfile(fs fs.FS, path string) (index.Index, error) {
return index.NewFromIdx(f)
}
+func (s *ObjectStorage) NewObject() core.Object {
+ return &core.MemoryObject{}
+}
+
// Set adds a new object to the storage. As this functionality is not
// yet supported, this method always returns a "not implemented yet"
// error an zero hash.
@@ -131,7 +135,8 @@ func (s *ObjectStorage) Get(h core.Hash) (core.Object, error) {
r.HashToOffset = map[core.Hash]int64(s.index)
p := packfile.NewParser(r)
- return p.ReadObject()
+ obj := s.NewObject()
+ return obj, p.FillObject(obj)
}
// Iter returns an iterator for all the objects in the packfile with the