diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-21 01:06:59 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-21 01:06:59 +0200 |
commit | c9f0c29f423f9bb26f32d6e8c7098f275171afb9 (patch) | |
tree | 9c746b16c92a6820f34d504a2a2dd6881d65f559 /storage/filesystem/storage.go | |
parent | 4652c0e753c88e63ba111d49aa58edc655806c03 (diff) | |
download | go-git-c9f0c29f423f9bb26f32d6e8c7098f275171afb9.tar.gz |
storage/filesystem: ConfigStore implementation
Diffstat (limited to 'storage/filesystem/storage.go')
-rw-r--r-- | storage/filesystem/storage.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/storage/filesystem/storage.go b/storage/filesystem/storage.go index 63d0215..c483218 100644 --- a/storage/filesystem/storage.go +++ b/storage/filesystem/storage.go @@ -1,6 +1,7 @@ package filesystem import ( + "gopkg.in/src-d/go-git.v4/config" "gopkg.in/src-d/go-git.v4/core" "gopkg.in/src-d/go-git.v4/storage/filesystem/internal/dotgit" "gopkg.in/src-d/go-git.v4/utils/fs" @@ -11,6 +12,7 @@ type Storage struct { o *ObjectStorage r *ReferenceStorage + c *ConfigStorage } func NewStorage(fs fs.FS, path string) (*Storage, error) { @@ -40,3 +42,12 @@ func (s *Storage) ReferenceStorage() core.ReferenceStorage { s.r = &ReferenceStorage{dir: s.dir} return s.r } + +func (s *Storage) ConfigStorage() config.ConfigStorage { + if s.c != nil { + return s.c + } + + s.c = &ConfigStorage{dir: s.dir} + return s.c +} |