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.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/storage/filesystem/storage.go b/storage/filesystem/storage.go
index 7021d3a..9895507 100644
--- a/storage/filesystem/storage.go
+++ b/storage/filesystem/storage.go
@@ -11,11 +11,14 @@ import (
// standard git format (this is, the .git directory). Zero values of this type
// are not safe to use, see the NewStorage function below.
type Storage struct {
+ fs billy.Filesystem
+
ObjectStorage
ReferenceStorage
IndexStorage
ShallowStorage
ConfigStorage
+ ModuleStorage
}
// NewStorage returns a new Storage backed by a given `fs.Filesystem`
@@ -27,10 +30,18 @@ func NewStorage(fs billy.Filesystem) (*Storage, error) {
}
return &Storage{
+ fs: fs,
+
ObjectStorage: o,
ReferenceStorage: ReferenceStorage{dir: dir},
IndexStorage: IndexStorage{dir: dir},
ShallowStorage: ShallowStorage{dir: dir},
ConfigStorage: ConfigStorage{dir: dir},
+ ModuleStorage: ModuleStorage{dir: dir},
}, nil
}
+
+// Filesystem returns the underlying filesystem
+func (s *Storage) Filesystem() billy.Filesystem {
+ return s.fs
+}