diff options
Diffstat (limited to 'storage')
-rw-r--r-- | storage/filesystem/config.go | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/storage/filesystem/config.go b/storage/filesystem/config.go index 01b35b4..78a6464 100644 --- a/storage/filesystem/config.go +++ b/storage/filesystem/config.go @@ -1,7 +1,6 @@ package filesystem import ( - stdioutil "io/ioutil" "os" "github.com/go-git/go-git/v5/config" @@ -14,29 +13,17 @@ type ConfigStorage struct { } func (c *ConfigStorage) Config() (conf *config.Config, err error) { - cfg := config.NewConfig() - f, err := c.dir.Config() if err != nil { if os.IsNotExist(err) { - return cfg, nil + return config.NewConfig(), nil } return nil, err } defer ioutil.CheckClose(f, &err) - - b, err := stdioutil.ReadAll(f) - if err != nil { - return nil, err - } - - if err = cfg.Unmarshal(b); err != nil { - return nil, err - } - - return cfg, err + return config.ReadConfig(f) } func (c *ConfigStorage) SetConfig(cfg *config.Config) (err error) { |