diff options
Diffstat (limited to 'storage/filesystem')
-rw-r--r-- | storage/filesystem/object_test.go | 5 | ||||
-rw-r--r-- | storage/filesystem/storage.go | 20 |
2 files changed, 9 insertions, 16 deletions
diff --git a/storage/filesystem/object_test.go b/storage/filesystem/object_test.go index 5c4c7c8..8bca5c6 100644 --- a/storage/filesystem/object_test.go +++ b/storage/filesystem/object_test.go @@ -76,10 +76,7 @@ func (s *FsSuite) newObjectStorage(c *C, fixtureName string) core.ObjectStorage store, err := NewStorage(fs, fs.Join(path, ".git/")) c.Assert(err, IsNil) - obj, err := store.ObjectStorage() - c.Assert(err, IsNil) - - return obj + return store.ObjectStorage() } func (s *FsSuite) TestGetCompareWithMemoryStorage(c *C) { diff --git a/storage/filesystem/storage.go b/storage/filesystem/storage.go index 8f9c555..63d0215 100644 --- a/storage/filesystem/storage.go +++ b/storage/filesystem/storage.go @@ -22,25 +22,21 @@ func NewStorage(fs fs.FS, path string) (*Storage, error) { return &Storage{dir: dir}, nil } -func (s *Storage) ObjectStorage() (core.ObjectStorage, error) { +func (s *Storage) ObjectStorage() core.ObjectStorage { if s.o != nil { - return s.o, nil + return s.o } - i, err := buildIndex(s.dir) - if err != nil { - return nil, err - } - - s.o = &ObjectStorage{dir: s.dir, index: i} - return s.o, nil + //TODO: error being ignored + i, _ := buildIndex(s.dir) + return &ObjectStorage{dir: s.dir, index: i} } -func (s *Storage) ReferenceStorage() (core.ReferenceStorage, error) { +func (s *Storage) ReferenceStorage() core.ReferenceStorage { if s.r != nil { - return s.r, nil + return s.r } s.r = &ReferenceStorage{dir: s.dir} - return s.r, nil + return s.r } |