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_identity.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_identity.go')
-rw-r--r-- | cache/repo_cache_identity.go | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/cache/repo_cache_identity.go b/cache/repo_cache_identity.go index 8957d4aa..8df5b810 100644 --- a/cache/repo_cache_identity.go +++ b/cache/repo_cache_identity.go @@ -4,20 +4,13 @@ import ( "bytes" "encoding/gob" "fmt" - "os" - "path" "github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/identity" - "github.com/MichaelMure/git-bug/repository" ) const identityCacheFile = "identity-cache" -func identityCacheFilePath(repo repository.Repo) string { - return path.Join(repo.GetPath(), "git-bug", identityCacheFile) -} - // identityUpdated is a callback to trigger when the excerpt of an identity // changed, that is each time an identity is updated func (c *RepoCache) identityUpdated(id entity.Id) error { @@ -41,7 +34,7 @@ func (c *RepoCache) loadIdentityCache() error { c.muIdentity.Lock() defer c.muIdentity.Unlock() - f, err := os.Open(identityCacheFilePath(c.repo)) + f, err := c.repo.LocalStorage().Open(identityCacheFile) if err != nil { return err } @@ -88,7 +81,7 @@ func (c *RepoCache) writeIdentityCache() error { return err } - f, err := os.Create(identityCacheFilePath(c.repo)) + f, err := c.repo.LocalStorage().Create(identityCacheFile) if err != nil { return err } |