aboutsummaryrefslogtreecommitdiffstats
path: root/cache/repo_cache_bug.go
diff options
context:
space:
mode:
authorSteve Moyer <smoyer1@selesy.com>2022-08-23 10:33:19 -0400
committerSteve Moyer <smoyer1@selesy.com>2022-08-23 10:33:19 -0400
commit7ba98bfadc2c4c7fd3e777074976b78d6171b163 (patch)
tree4865a84837a016e9a18b566046a2aa7a1992acc7 /cache/repo_cache_bug.go
parent2c2c449187557384fd1e5b9333e808451be86041 (diff)
parent5a70e8b3a2e0fe3d1a1dcd4c24bb6bf64633cb7f (diff)
downloadgit-bug-7ba98bfadc2c4c7fd3e777074976b78d6171b163.tar.gz
Merge branch 'master' into fix-850-ineffective-comment-edit
Diffstat (limited to 'cache/repo_cache_bug.go')
-rw-r--r--cache/repo_cache_bug.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/cache/repo_cache_bug.go b/cache/repo_cache_bug.go
index a3f195ff..4522f1bc 100644
--- a/cache/repo_cache_bug.go
+++ b/cache/repo_cache_bug.go
@@ -12,7 +12,7 @@ import (
"github.com/blevesearch/bleve"
- "github.com/MichaelMure/git-bug/bug"
+ "github.com/MichaelMure/git-bug/entities/bug"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/query"
"github.com/MichaelMure/git-bug/repository"
@@ -263,7 +263,7 @@ func (c *RepoCache) resolveBugMatcher(f func(*BugExcerpt) bool) (entity.Id, erro
// ResolveComment search for a Bug/Comment combination matching the merged
// bug/comment Id prefix. Returns the Bug containing the Comment and the Comment's
// Id.
-func (c *RepoCache) ResolveComment(prefix string) (*BugCache, entity.Id, error) {
+func (c *RepoCache) ResolveComment(prefix string) (*BugCache, entity.CombinedId, error) {
bugPrefix, _ := entity.SeparateIds(prefix)
bugCandidate := make([]entity.Id, 0, 5)
@@ -277,7 +277,7 @@ func (c *RepoCache) ResolveComment(prefix string) (*BugCache, entity.Id, error)
c.muBug.RUnlock()
matchingBugIds := make([]entity.Id, 0, 5)
- matchingCommentId := entity.UnsetId
+ matchingCommentId := entity.UnsetCombinedId
var matchingBug *BugCache
// search for matching comments
@@ -286,22 +286,22 @@ func (c *RepoCache) ResolveComment(prefix string) (*BugCache, entity.Id, error)
for _, bugId := range bugCandidate {
b, err := c.ResolveBug(bugId)
if err != nil {
- return nil, entity.UnsetId, err
+ return nil, entity.UnsetCombinedId, err
}
for _, comment := range b.Snapshot().Comments {
- if comment.Id().HasPrefix(prefix) {
+ if comment.CombinedId().HasPrefix(prefix) {
matchingBugIds = append(matchingBugIds, bugId)
matchingBug = b
- matchingCommentId = comment.Id()
+ matchingCommentId = comment.CombinedId()
}
}
}
if len(matchingBugIds) > 1 {
- return nil, entity.UnsetId, entity.NewErrMultipleMatch("bug/comment", matchingBugIds)
+ return nil, entity.UnsetCombinedId, entity.NewErrMultipleMatch("bug/comment", matchingBugIds)
} else if len(matchingBugIds) == 0 {
- return nil, entity.UnsetId, errors.New("comment doesn't exist")
+ return nil, entity.UnsetCombinedId, errors.New("comment doesn't exist")
}
return matchingBug, matchingCommentId, nil