aboutsummaryrefslogtreecommitdiffstats
path: root/cache/repo_cache_common.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-12-05 03:08:54 +0100
committerMichael Muré <batolettre@gmail.com>2020-12-08 13:07:51 +0100
commit4ef2c1104079032336da9f2a7879f2432c2609ce (patch)
treec233921001ae0f43d5d1c62ad50148d2c5bb2e35 /cache/repo_cache_common.go
parentbca9ae82745ffd619fd321f4200016c184849f94 (diff)
downloadgit-bug-4ef2c1104079032336da9f2a7879f2432c2609ce.tar.gz
repo: finish RepoStorage move
Diffstat (limited to 'cache/repo_cache_common.go')
-rw-r--r--cache/repo_cache_common.go24
1 files changed, 13 insertions, 11 deletions
diff --git a/cache/repo_cache_common.go b/cache/repo_cache_common.go
index 95e2f7bb..5dc19d22 100644
--- a/cache/repo_cache_common.go
+++ b/cache/repo_cache_common.go
@@ -3,6 +3,7 @@ package cache
import (
"fmt"
+ "github.com/go-git/go-billy/v5"
"github.com/pkg/errors"
"github.com/MichaelMure/git-bug/bug"
@@ -30,13 +31,19 @@ func (c *RepoCache) AnyConfig() repository.ConfigRead {
return c.repo.AnyConfig()
}
+// Keyring give access to a user-wide storage for secrets
func (c *RepoCache) Keyring() repository.Keyring {
return c.repo.Keyring()
}
-// GetPath returns the path to the repo.
-func (c *RepoCache) GetPath() string {
- return c.repo.GetPath()
+// GetUserName returns the name the the user has used to configure git
+func (c *RepoCache) GetUserName() (string, error) {
+ return c.repo.GetUserName()
+}
+
+// GetUserEmail returns the email address that the user has used to configure git.
+func (c *RepoCache) GetUserEmail() (string, error) {
+ return c.repo.GetUserEmail()
}
// GetCoreEditor returns the name of the editor that the user has used to configure git.
@@ -49,14 +56,9 @@ func (c *RepoCache) GetRemotes() (map[string]string, error) {
return c.repo.GetRemotes()
}
-// GetUserName returns the name the the user has used to configure git
-func (c *RepoCache) GetUserName() (string, error) {
- return c.repo.GetUserName()
-}
-
-// GetUserEmail returns the email address that the user has used to configure git.
-func (c *RepoCache) GetUserEmail() (string, error) {
- return c.repo.GetUserEmail()
+// LocalStorage return a billy.Filesystem giving access to $RepoPath/.git/git-bug
+func (c *RepoCache) LocalStorage() billy.Filesystem {
+ return c.repo.LocalStorage()
}
// ReadData will attempt to read arbitrary data from the given hash