diff options
author | Michael Muré <batolettre@gmail.com> | 2019-07-06 16:32:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-06 16:32:57 +0200 |
commit | f4d4b2f41326d08fdfa574cd4732e950fa9532d8 (patch) | |
tree | 04cdd9508bf8c2fd1f3b928dd419a15cdb9709d0 /cache/bug_cache.go | |
parent | aa4464dbba0b1e0ce39ae53e35971e6924d404d3 (diff) | |
parent | 9e611ee66787b9f005540395da2ea10b3320362c (diff) | |
download | git-bug-f4d4b2f41326d08fdfa574cd4732e950fa9532d8.tar.gz |
Merge pull request #166 from MichaelMure/github-exporter
[Bridge] GitHub exporter
Diffstat (limited to 'cache/bug_cache.go')
-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..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 { |