aboutsummaryrefslogtreecommitdiffstats
path: root/cache/repo_cache_identity.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_identity.go
parentbca9ae82745ffd619fd321f4200016c184849f94 (diff)
downloadgit-bug-4ef2c1104079032336da9f2a7879f2432c2609ce.tar.gz
repo: finish RepoStorage move
Diffstat (limited to 'cache/repo_cache_identity.go')
-rw-r--r--cache/repo_cache_identity.go11
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
}