aboutsummaryrefslogtreecommitdiffstats
path: root/cache/bug_cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'cache/bug_cache.go')
-rw-r--r--cache/bug_cache.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/cache/bug_cache.go b/cache/bug_cache.go
index aad6dab8..758fb0b7 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, newMetadata)
+}
+
+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 {