From 498dbf7dc92e288641f1af1acc52704150e8a6c0 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Sun, 12 Feb 2017 23:03:30 +0100 Subject: storage: git.Storer move to storage.Storer and module handling --- storage/filesystem/storage.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'storage/filesystem/storage.go') diff --git a/storage/filesystem/storage.go b/storage/filesystem/storage.go index 7021d3a..27dd07f 100644 --- a/storage/filesystem/storage.go +++ b/storage/filesystem/storage.go @@ -16,6 +16,7 @@ type Storage struct { IndexStorage ShallowStorage ConfigStorage + ModuleStorage } // NewStorage returns a new Storage backed by a given `fs.Filesystem` @@ -32,5 +33,6 @@ func NewStorage(fs billy.Filesystem) (*Storage, error) { IndexStorage: IndexStorage{dir: dir}, ShallowStorage: ShallowStorage{dir: dir}, ConfigStorage: ConfigStorage{dir: dir}, + ModuleStorage: ModuleStorage{dir: dir}, }, nil } -- cgit From 65351f835dcaa4b50dd44bce7bf3f2e31582dadc Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Mon, 13 Feb 2017 23:59:49 +0100 Subject: Repository.Init now handles non-standard .git location --- storage/filesystem/storage.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'storage/filesystem/storage.go') diff --git a/storage/filesystem/storage.go b/storage/filesystem/storage.go index 27dd07f..9895507 100644 --- a/storage/filesystem/storage.go +++ b/storage/filesystem/storage.go @@ -11,6 +11,8 @@ 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 @@ -28,6 +30,8 @@ func NewStorage(fs billy.Filesystem) (*Storage, error) { } return &Storage{ + fs: fs, + ObjectStorage: o, ReferenceStorage: ReferenceStorage{dir: dir}, IndexStorage: IndexStorage{dir: dir}, @@ -36,3 +40,8 @@ func NewStorage(fs billy.Filesystem) (*Storage, error) { ModuleStorage: ModuleStorage{dir: dir}, }, nil } + +// Filesystem returns the underlying filesystem +func (s *Storage) Filesystem() billy.Filesystem { + return s.fs +} -- cgit