diff options
author | Michael Muré <batolettre@gmail.com> | 2019-02-18 23:16:47 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-03-01 22:40:26 +0100 |
commit | 54f9838f0ab22ce5285f21cdd117ad81c737d822 (patch) | |
tree | f6439599dec013d8f30620b5a534a1ebdb8f7388 /cache/identity_cache.go | |
parent | 947ea63522610bd16c32cf70812c129eda9bbb02 (diff) | |
download | git-bug-54f9838f0ab22ce5285f21cdd117ad81c737d822.tar.gz |
identity: working identity cache
Diffstat (limited to 'cache/identity_cache.go')
-rw-r--r-- | cache/identity_cache.go | 17 |
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() } |