aboutsummaryrefslogtreecommitdiffstats
path: root/cache
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-13 12:20:28 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-13 12:20:28 +0200
commitf569e6aacc0690e7b1bebf33a10a8e0d154937df (patch)
treec17ac2201b7abbc6889137d968c8450dc3099f9a /cache
parent8a25c63d6972d9168dcb3599066076bdb84f8790 (diff)
downloadgit-bug-f569e6aacc0690e7b1bebf33a10a8e0d154937df.tar.gz
operations: return a more convenient array of result for label changes
Diffstat (limited to 'cache')
-rw-r--r--cache/bug_cache.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/cache/bug_cache.go b/cache/bug_cache.go
index cbb0d15a..67c16e96 100644
--- a/cache/bug_cache.go
+++ b/cache/bug_cache.go
@@ -1,8 +1,6 @@
package cache
import (
- "io"
-
"github.com/MichaelMure/git-bug/bug"
"github.com/MichaelMure/git-bug/operations"
"github.com/MichaelMure/git-bug/util/git"
@@ -51,18 +49,23 @@ func (c *BugCache) AddCommentWithFiles(message string, files []git.Hash) error {
return c.notifyUpdated()
}
-func (c *BugCache) ChangeLabels(out io.Writer, added []string, removed []string) error {
+func (c *BugCache) ChangeLabels(added []string, removed []string) ([]operations.LabelChangeResult, error) {
author, err := bug.GetUser(c.repoCache.repo)
if err != nil {
- return err
+ return nil, err
}
- err = operations.ChangeLabels(out, c.bug, author, added, removed)
+ changes, err := operations.ChangeLabels(c.bug, author, added, removed)
if err != nil {
- return err
+ return changes, err
}
- return c.notifyUpdated()
+ err = c.notifyUpdated()
+ if err != nil {
+ return nil, err
+ }
+
+ return changes, nil
}
func (c *BugCache) Open() error {