aboutsummaryrefslogtreecommitdiffstats
path: root/cache/identity_cache.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-02-18 23:16:47 +0100
committerMichael Muré <batolettre@gmail.com>2019-03-01 22:40:26 +0100
commit54f9838f0ab22ce5285f21cdd117ad81c737d822 (patch)
treef6439599dec013d8f30620b5a534a1ebdb8f7388 /cache/identity_cache.go
parent947ea63522610bd16c32cf70812c129eda9bbb02 (diff)
downloadgit-bug-54f9838f0ab22ce5285f21cdd117ad81c737d822.tar.gz
identity: working identity cache
Diffstat (limited to 'cache/identity_cache.go')
-rw-r--r--cache/identity_cache.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/cache/identity_cache.go b/cache/identity_cache.go
index c49e9519..2ae55f2d 100644
--- a/cache/identity_cache.go
+++ b/cache/identity_cache.go
@@ -21,10 +21,23 @@ func (i *IdentityCache) notifyUpdated() error {
return i.repoCache.identityUpdated(i.Identity.Id())
}
+func (i *IdentityCache) AddVersion(version *identity.Version) error {
+ i.Identity.AddVersion(version)
+ return i.notifyUpdated()
+}
+
func (i *IdentityCache) Commit() error {
- return i.Identity.Commit(i.repoCache.repo)
+ err := i.Identity.Commit(i.repoCache.repo)
+ if err != nil {
+ return err
+ }
+ return i.notifyUpdated()
}
func (i *IdentityCache) CommitAsNeeded() error {
- return i.Identity.CommitAsNeeded(i.repoCache.repo)
+ err := i.Identity.CommitAsNeeded(i.repoCache.repo)
+ if err != nil {
+ return err
+ }
+ return i.notifyUpdated()
}