aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-05-24 16:53:30 +0200
committerGitHub <noreply@github.com>2020-05-24 16:53:30 +0200
commite7f544844d6d736acfd9d75ee0d4a9d37f450103 (patch)
treedc44247231e6603bf10acaee91af5523120b4b84 /repository_test.go
parent6d8103df45ce09ffd5323b4ef46d26440400a54f (diff)
parentbaf8c2761217cd457ef672972d5c1fb4d066e95a (diff)
downloadgo-git-e7f544844d6d736acfd9d75ee0d4a9d37f450103.tar.gz
Merge pull request #75 from mcuadros/scope-config
repository.ConfigScoped and worktree.Commit with empty CommitOptions
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go15
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{