aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/storage.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-09-06 01:56:41 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-09-06 01:56:41 +0200
commitae2b10d50da5455b382ab9d543be4fe859afe9e0 (patch)
tree58cf3247a7283769c77df945f1be9a5d70e65a69 /storage/filesystem/storage.go
parent0b7aa259fe3da2236952843fe46db62bdee395eb (diff)
downloadgo-git-ae2b10d50da5455b382ab9d543be4fe859afe9e0.tar.gz
storage: filesystem idx generation (wip)
Diffstat (limited to 'storage/filesystem/storage.go')
-rw-r--r--storage/filesystem/storage.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/storage/filesystem/storage.go b/storage/filesystem/storage.go
index a0cb0b1..b0eaf6f 100644
--- a/storage/filesystem/storage.go
+++ b/storage/filesystem/storage.go
@@ -10,19 +10,15 @@ import (
type Storage struct {
dir *dotgit.DotGit
+ fs fs.Filesystem
o *ObjectStorage
r *ReferenceStorage
c *ConfigStorage
}
-func NewStorage(fs fs.FS, path string) (*Storage, error) {
- dir, err := dotgit.New(fs, path)
- if err != nil {
- return nil, err
- }
-
- return &Storage{dir: dir}, nil
+func NewStorage(fs fs.Filesystem) (*Storage, error) {
+ return &Storage{dir: dotgit.New(fs), fs: fs}, nil
}
func (s *Storage) ObjectStorage() core.ObjectStorage {
@@ -31,7 +27,7 @@ func (s *Storage) ObjectStorage() core.ObjectStorage {
}
//TODO: error being ignored
- i, _ := buildIndex(s.dir)
+ i, _ := buildIndex(s.fs, s.dir)
return &ObjectStorage{dir: s.dir, index: i}
}