diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2020-05-24 11:23:04 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2020-05-24 11:23:04 +0200 |
commit | 86c0c010927fe59ae54563a9a86db200a18f4c2e (patch) | |
tree | f83e183db75f414163ab8422ac6e00c0f6eebf31 /repository_test.go | |
parent | 26d02b3fec4434d663445d580497204e79284db0 (diff) | |
download | go-git-86c0c010927fe59ae54563a9a86db200a18f4c2e.tar.gz |
Repository.ConfigScoped and Repository.Commit with empty author support
Diffstat (limited to 'repository_test.go')
-rw-r--r-- | repository_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/repository_test.go b/repository_test.go index e366373..37cd914 100644 --- a/repository_test.go +++ b/repository_test.go @@ -1870,6 +1870,21 @@ func (s *RepositorySuite) TestLogLimitWithOtherParamsPass(c *C) { c.Assert(iterErr, Equals, io.EOF) } +func (s *RepositorySuite) TestConfigScoped(c *C) { + r, _ := Init(memory.NewStorage(), nil) + err := r.clone(context.Background(), &CloneOptions{ + URL: s.GetBasicLocalRepositoryURL(), + }) + + cfg, err := r.ConfigScoped(config.LocalScope) + c.Assert(err, IsNil) + c.Assert(cfg.User.Email, Equals, "") + + cfg, err = r.ConfigScoped(config.SystemScope) + c.Assert(err, IsNil) + c.Assert(cfg.User.Email, Not(Equals), "") +} + func (s *RepositorySuite) TestCommit(c *C) { r, _ := Init(memory.NewStorage(), nil) err := r.clone(context.Background(), &CloneOptions{ |