summaryrefslogtreecommitdiffstatshomepage
path: root/cache
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2024-08-25 20:40:23 +0200
committerGitHub <noreply@github.com>2024-08-25 18:40:23 +0000
commit3a4b8805dfd794cc25f57e99c73ddec651805af1 (patch)
treeb6af67c761c96b323400d061db22ceed73fb0bb0 /cache
parentc3ff05f95bdfad6c2ea4cb899024fd47ac503b5f (diff)
downloadgit-bug-3a4b8805dfd794cc25f57e99c73ddec651805af1.tar.gz
git-bug-3a4b8805dfd794cc25f57e99c73ddec651805af1.zip
core: make label a common type, in a similar fashion as for status (#1252)
This will be useful for Board, and likely code review support later
Diffstat (limited to 'cache')
-rw-r--r--cache/bug_excerpt.go3
-rw-r--r--cache/bug_subcache.go7
2 files changed, 5 insertions, 5 deletions
diff --git a/cache/bug_excerpt.go b/cache/bug_excerpt.go
index 12331b628..99c304095 100644
--- a/cache/bug_excerpt.go
+++ b/cache/bug_excerpt.go
@@ -4,7 +4,6 @@ import (
"encoding/gob"
"time"
- "github.com/git-bug/git-bug/entities/bug"
"github.com/git-bug/git-bug/entities/common"
"github.com/git-bug/git-bug/entity"
"github.com/git-bug/git-bug/util/lamport"
@@ -29,7 +28,7 @@ type BugExcerpt struct {
AuthorId entity.Id
Status common.Status
- Labels []bug.Label
+ Labels []common.Label
Title string
LenComments int
Actors []entity.Id
diff --git a/cache/bug_subcache.go b/cache/bug_subcache.go
index a1f4498a7..09d7cbba6 100644
--- a/cache/bug_subcache.go
+++ b/cache/bug_subcache.go
@@ -6,6 +6,7 @@ import (
"time"
"github.com/git-bug/git-bug/entities/bug"
+ "github.com/git-bug/git-bug/entities/common"
"github.com/git-bug/git-bug/entities/identity"
"github.com/git-bug/git-bug/entity"
"github.com/git-bug/git-bug/query"
@@ -187,11 +188,11 @@ func (c *RepoCacheBug) Query(q *query.Query) ([]entity.Id, error) {
// Note: in the future, a proper label policy could be implemented where valid
// labels are defined in a configuration file. Until that, the default behavior
// is to return the list of labels already used.
-func (c *RepoCacheBug) ValidLabels() []bug.Label {
+func (c *RepoCacheBug) ValidLabels() []common.Label {
c.mu.RLock()
defer c.mu.RUnlock()
- set := map[bug.Label]interface{}{}
+ set := map[common.Label]interface{}{}
for _, excerpt := range c.excerpts {
for _, l := range excerpt.Labels {
@@ -199,7 +200,7 @@ func (c *RepoCacheBug) ValidLabels() []bug.Label {
}
}
- result := make([]bug.Label, len(set))
+ result := make([]common.Label, len(set))
i := 0
for l := range set {