diff options
Diffstat (limited to 'cache')
-rw-r--r-- | cache/multi_repo_cache.go | 4 | ||||
-rw-r--r-- | cache/repo_cache.go | 26 |
2 files changed, 22 insertions, 8 deletions
diff --git a/cache/multi_repo_cache.go b/cache/multi_repo_cache.go index c5328b7e..ec435ff2 100644 --- a/cache/multi_repo_cache.go +++ b/cache/multi_repo_cache.go @@ -19,7 +19,7 @@ func NewMultiRepoCache() MultiRepoCache { } // RegisterRepository register a named repository. Use this for multi-repo setup -func (c *MultiRepoCache) RegisterRepository(ref string, repo repository.Repo) error { +func (c *MultiRepoCache) RegisterRepository(ref string, repo repository.ClockedRepo) error { r, err := NewRepoCache(repo) if err != nil { return err @@ -30,7 +30,7 @@ func (c *MultiRepoCache) RegisterRepository(ref string, repo repository.Repo) er } // RegisterDefaultRepository register a unnamed repository. Use this for mono-repo setup -func (c *MultiRepoCache) RegisterDefaultRepository(repo repository.Repo) error { +func (c *MultiRepoCache) RegisterDefaultRepository(repo repository.ClockedRepo) error { r, err := NewRepoCache(repo) if err != nil { return err diff --git a/cache/repo_cache.go b/cache/repo_cache.go index 26f2855f..a43c6684 100644 --- a/cache/repo_cache.go +++ b/cache/repo_cache.go @@ -24,14 +24,14 @@ const formatVersion = 1 type RepoCache struct { // the underlying repo - repo repository.Repo + repo repository.ClockedRepo // excerpt of bugs data for all bugs excerpts map[string]*BugExcerpt // bug loaded in memory bugs map[string]*BugCache } -func NewRepoCache(r repository.Repo) (*RepoCache, error) { +func NewRepoCache(r repository.ClockedRepo) (*RepoCache, error) { c := &RepoCache{ repo: r, bugs: make(map[string]*BugCache), @@ -55,10 +55,24 @@ func NewRepoCache(r repository.Repo) (*RepoCache, error) { return c, c.write() } -// Repository return the underlying repository. -// If you use this, make sure to never change the repo state. -func (c *RepoCache) Repository() repository.Repo { - return c.repo +// GetPath returns the path to the repo. +func (c *RepoCache) GetPath() string { + return c.repo.GetPath() +} + +// GetPath returns the path to the repo. +func (c *RepoCache) GetCoreEditor() (string, error) { + return c.repo.GetCoreEditor() +} + +// 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() } func (c *RepoCache) lock() error { |