aboutsummaryrefslogtreecommitdiffstats
path: root/repository/mock_repo.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-09-27 00:54:14 +0200
committerMichael Muré <batolettre@gmail.com>2020-09-29 20:42:21 +0200
commit71b7eb14010be0c7799b4d5394798c89e379891b (patch)
treef82d4b7bc6be5165c093d4feb18f5ee642c2c3e6 /repository/mock_repo.go
parentc87e9abacfbdc4f221e2e328d4b229d6191f42e9 (diff)
downloadgit-bug-71b7eb14010be0c7799b4d5394798c89e379891b.tar.gz
repo: implement local/global/any config everywhere
Diffstat (limited to 'repository/mock_repo.go')
-rw-r--r--repository/mock_repo.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/repository/mock_repo.go b/repository/mock_repo.go
index 07425765..628939aa 100644
--- a/repository/mock_repo.go
+++ b/repository/mock_repo.go
@@ -35,20 +35,20 @@ func NewMockRepoForTest() *mockRepoForTest {
var _ RepoConfig = &mockRepoConfig{}
type mockRepoConfig struct {
- config *MemConfig
+ localConfig *MemConfig
globalConfig *MemConfig
}
func NewMockRepoConfig() *mockRepoConfig {
return &mockRepoConfig{
- config: NewMemConfig(),
+ localConfig: NewMemConfig(),
globalConfig: NewMemConfig(),
}
}
// LocalConfig give access to the repository scoped configuration
func (r *mockRepoConfig) LocalConfig() Config {
- return r.config
+ return r.localConfig
}
// GlobalConfig give access to the git global configuration
@@ -56,6 +56,11 @@ func (r *mockRepoConfig) GlobalConfig() Config {
return r.globalConfig
}
+// AnyConfig give access to a merged local/global configuration
+func (r *mockRepoConfig) AnyConfig() ConfigRead {
+ return mergeConfig(r.localConfig, r.globalConfig)
+}
+
var _ RepoKeyring = &mockRepoKeyring{}
type mockRepoKeyring struct {