From f09fb50cb092c241df4c0bd25c6755e6132e473e Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Fri, 9 Sep 2016 16:50:35 +0200 Subject: storage: filessytem read multiple packfiles support and index decoding --- storage/filesystem/storage.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'storage/filesystem/storage.go') 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 { -- cgit