diff options
author | Michael Muré <batolettre@gmail.com> | 2020-12-08 15:17:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 15:17:22 +0100 |
commit | bf476f98d1656850e2f3fd349adea504007a8313 (patch) | |
tree | 595f3875590c89fe1c5a30e2e732f8aee9b35361 /cache/repo_cache_common.go | |
parent | 54d123c6753d053df8400beea316e13690c851f4 (diff) | |
parent | 8128bb79b0db9023a98c356e4e173d846057c577 (diff) | |
download | git-bug-bf476f98d1656850e2f3fd349adea504007a8313.tar.gz |
Merge pull request #510 from MichaelMure/repo-rework
Repo rework
Diffstat (limited to 'cache/repo_cache_common.go')
-rw-r--r-- | cache/repo_cache_common.go | 24 |
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 |