aboutsummaryrefslogtreecommitdiffstats
path: root/termui
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-12-21 21:54:36 +0100
committerMichael Muré <batolettre@gmail.com>2022-12-21 21:54:36 +0100
commit9b98fc06489353053564b431ac0c0d73a5c55a56 (patch)
tree67cab95c0c6167c0982516a2dda610bd5ece9eab /termui
parent905c9a90f134842b97e2cf729d8b11ff59bfd766 (diff)
downloadgit-bug-9b98fc06489353053564b431ac0c0d73a5c55a56.tar.gz
cache: tie up the refactor up to compiling
Diffstat (limited to 'termui')
-rw-r--r--termui/bug_table.go12
-rw-r--r--termui/label_select.go2
-rw-r--r--termui/termui.go2
3 files changed, 8 insertions, 8 deletions
diff --git a/termui/bug_table.go b/termui/bug_table.go
index f3f8b2f3..9db13ada 100644
--- a/termui/bug_table.go
+++ b/termui/bug_table.go
@@ -239,7 +239,7 @@ func (bt *bugTable) disable(g *gocui.Gui) error {
func (bt *bugTable) paginate(max int) error {
var err error
- bt.allIds, err = bt.repo.QueryBugs(bt.query)
+ bt.allIds, err = bt.repo.Bugs().Query(bt.query)
if err != nil {
return err
}
@@ -265,7 +265,7 @@ func (bt *bugTable) doPaginate(max int) error {
bt.excerpts = make([]*cache.BugExcerpt, len(ids))
for i, id := range ids {
- excerpt, err := bt.repo.ResolveBugExcerpt(id)
+ excerpt, err := bt.repo.Bugs().ResolveExcerpt(id)
if err != nil {
return err
}
@@ -319,12 +319,12 @@ func (bt *bugTable) render(v *gocui.View, maxX int) {
labelsTxt.WriteString(lc256.Unescape())
}
- author, err := bt.repo.ResolveIdentityExcerpt(excerpt.AuthorId)
+ author, err := bt.repo.Identities().ResolveExcerpt(excerpt.AuthorId)
if err != nil {
panic(err)
}
- id := text.LeftPadMaxLine(excerpt.Id.Human(), columnWidths["id"], 0)
+ id := text.LeftPadMaxLine(excerpt.Id().Human(), columnWidths["id"], 0)
status := text.LeftPadMaxLine(excerpt.Status.String(), columnWidths["status"], 0)
labels := text.TruncateMax(labelsTxt.String(), minInt(columnWidths["title"]-2, 10))
title := text.LeftPadMaxLine(strings.TrimSpace(excerpt.Title), columnWidths["title"]-text.Len(labels), 0)
@@ -451,8 +451,8 @@ func (bt *bugTable) openBug(g *gocui.Gui, v *gocui.View) error {
// There are no open bugs, just do nothing
return nil
}
- id := bt.excerpts[bt.selectCursor].Id
- b, err := bt.repo.ResolveBug(id)
+ id := bt.excerpts[bt.selectCursor].Id()
+ b, err := bt.repo.Bugs().Resolve(id)
if err != nil {
return err
}
diff --git a/termui/label_select.go b/termui/label_select.go
index 2282583d..6721165e 100644
--- a/termui/label_select.go
+++ b/termui/label_select.go
@@ -37,7 +37,7 @@ func newLabelSelect() *labelSelect {
func (ls *labelSelect) SetBug(cache *cache.RepoCache, bug *cache.BugCache) {
ls.cache = cache
ls.bug = bug
- ls.labels = cache.ValidLabels()
+ ls.labels = cache.Bugs().ValidLabels()
// Find which labels are currently applied to the bug
bugLabels := bug.Snapshot().Labels
diff --git a/termui/termui.go b/termui/termui.go
index 4dd6e27d..79577ba9 100644
--- a/termui/termui.go
+++ b/termui/termui.go
@@ -200,7 +200,7 @@ func newBugWithEditor(repo *cache.RepoCache) error {
return errTerminateMainloop
} else {
- b, _, err = repo.NewBug(
+ b, _, err = repo.Bugs().New(
text.CleanupOneLine(title),
text.Cleanup(message),
)