aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/storage.go
diff options
context:
space:
mode:
Diffstat (limited to 'storage/filesystem/storage.go')
-rw-r--r--storage/filesystem/storage.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/storage/filesystem/storage.go b/storage/filesystem/storage.go
index b0eaf6f..d39d6e4 100644
--- a/storage/filesystem/storage.go
+++ b/storage/filesystem/storage.go
@@ -18,17 +18,17 @@ type Storage struct {
}
func NewStorage(fs fs.Filesystem) (*Storage, error) {
- return &Storage{dir: dotgit.New(fs), fs: fs}, nil
+ dir := dotgit.New(fs)
+ o, err := newObjectStorage(dir)
+ if err != nil {
+ return nil, err
+ }
+
+ return &Storage{dir: dir, fs: fs, o: o}, nil
}
func (s *Storage) ObjectStorage() core.ObjectStorage {
- if s.o != nil {
- return s.o
- }
-
- //TODO: error being ignored
- i, _ := buildIndex(s.fs, s.dir)
- return &ObjectStorage{dir: s.dir, index: i}
+ return s.o
}
func (s *Storage) ReferenceStorage() core.ReferenceStorage {