diff options
Diffstat (limited to 'cache')
-rw-r--r-- | cache/bug_cache.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cache/bug_cache.go b/cache/bug_cache.go index aad6dab8..36f2139e 100644 --- a/cache/bug_cache.go +++ b/cache/bug_cache.go @@ -254,6 +254,24 @@ func (c *BugCache) EditCommentRaw(author *IdentityCache, unixTime int64, target return op, c.notifyUpdated() } +func (c *BugCache) SetMetadata(target git.Hash, newMetadata map[string]string) (*bug.SetMetadataOperation, error) { + author, err := c.repoCache.GetUserIdentity() + if err != nil { + return nil, err + } + + return c.SetMetadataRaw(author, time.Now().Unix(), target, nil) +} + +func (c *BugCache) SetMetadataRaw(author *IdentityCache, unixTime int64, target git.Hash, newMetadata map[string]string) (*bug.SetMetadataOperation, error) { + op, err := bug.SetMetadata(c.bug, author.Identity, unixTime, target, newMetadata) + if err != nil { + return nil, err + } + + return op, c.notifyUpdated() +} + func (c *BugCache) Commit() error { err := c.bug.Commit(c.repoCache.repo) if err != nil { |