aboutsummaryrefslogtreecommitdiffstats
path: root/cache
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-11-01 22:16:57 +0000
committerGitHub <noreply@github.com>2019-11-01 22:16:57 +0000
commitf5193cc76dd1a1c1bb55194a64ef90bae2278115 (patch)
tree74c5f184df4fb27bec0d6f809ce9816ec133d80f /cache
parent11b4a1beb7e1ab8809515a5ce21e8708fba7f300 (diff)
parentf9f82957a78ea0d3cacddbc6914ce98b94ddf7bd (diff)
downloadgit-bug-f5193cc76dd1a1c1bb55194a64ef90bae2278115.tar.gz
Merge pull request #240 from MichaelMure/repo-config
repository config interface and implementation rework
Diffstat (limited to 'cache')
-rw-r--r--cache/repo_cache.go35
1 files changed, 10 insertions, 25 deletions
diff --git a/cache/repo_cache.go b/cache/repo_cache.go
index bc095856..ec4cf436 100644
--- a/cache/repo_cache.go
+++ b/cache/repo_cache.go
@@ -99,6 +99,16 @@ func NewRepoCache(r repository.ClockedRepo) (*RepoCache, error) {
return c, c.write()
}
+// LocalConfig give access to the repository scoped configuration
+func (c *RepoCache) LocalConfig() repository.Config {
+ return c.repo.LocalConfig()
+}
+
+// GlobalConfig give access to the git global configuration
+func (c *RepoCache) GlobalConfig() repository.Config {
+ return c.repo.GlobalConfig()
+}
+
// GetPath returns the path to the repo.
func (c *RepoCache) GetPath() string {
return c.repo.GetPath()
@@ -124,31 +134,6 @@ func (c *RepoCache) GetUserEmail() (string, error) {
return c.repo.GetUserEmail()
}
-// StoreConfig store a single key/value pair in the config of the repo
-func (c *RepoCache) StoreConfig(key string, value string) error {
- return c.repo.StoreConfig(key, value)
-}
-
-// ReadConfigs read all key/value pair matching the key prefix
-func (c *RepoCache) ReadConfigs(keyPrefix string) (map[string]string, error) {
- return c.repo.ReadConfigs(keyPrefix)
-}
-
-// ReadConfigBool read a single boolean value from the config
-func (c *RepoCache) ReadConfigBool(key string) (bool, error) {
- return c.repo.ReadConfigBool(key)
-}
-
-// ReadConfigBool read a single string value from the config
-func (c *RepoCache) ReadConfigString(key string) (string, error) {
- return c.repo.ReadConfigString(key)
-}
-
-// RmConfigs remove all key/value pair matching the key prefix
-func (c *RepoCache) RmConfigs(keyPrefix string) error {
- return c.repo.RmConfigs(keyPrefix)
-}
-
func (c *RepoCache) lock() error {
lockPath := repoLockFilePath(c.repo)