aboutsummaryrefslogtreecommitdiffstats
path: root/cache/bug_cache.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-31 13:18:03 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-31 17:22:10 +0200
commit7397c94d993541b33e555b758ebdb8f61ff33c6c (patch)
treedbdc52bb6efa03791e5ca84bc8695da5103524d2 /cache/bug_cache.go
parent116a94401f0d3fbf79f7e20716b1c7b739e33246 (diff)
downloadgit-bug-7397c94d993541b33e555b758ebdb8f61ff33c6c.tar.gz
make CLI commands use the cache to lock the repo properly
Diffstat (limited to 'cache/bug_cache.go')
-rw-r--r--cache/bug_cache.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/cache/bug_cache.go b/cache/bug_cache.go
index 7df76efe..c9e1f2f5 100644
--- a/cache/bug_cache.go
+++ b/cache/bug_cache.go
@@ -1,6 +1,8 @@
package cache
import (
+ "io"
+
"github.com/MichaelMure/git-bug/bug"
"github.com/MichaelMure/git-bug/bug/operations"
"github.com/MichaelMure/git-bug/util"
@@ -22,6 +24,10 @@ func (c *BugCache) Snapshot() *bug.Snapshot {
return c.bug.Snapshot()
}
+func (c *BugCache) HumanId() string {
+ return c.bug.HumanId()
+}
+
func (c *BugCache) notifyUpdated() error {
return c.repoCache.bugUpdated(c.bug.Id())
}
@@ -45,13 +51,13 @@ func (c *BugCache) AddCommentWithFiles(message string, files []util.Hash) error
return c.notifyUpdated()
}
-func (c *BugCache) ChangeLabels(added []string, removed []string) error {
+func (c *BugCache) ChangeLabels(out io.Writer, added []string, removed []string) error {
author, err := bug.GetUser(c.repoCache.repo)
if err != nil {
return err
}
- err = operations.ChangeLabels(nil, c.bug, author, added, removed)
+ err = operations.ChangeLabels(out, c.bug, author, added, removed)
if err != nil {
return err
}