summaryrefslogtreecommitdiffstats
path: root/pkg/gui/context
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-10-02 11:41:11 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-10-02 11:44:51 +1100
commitb726fd44e794d5260e4d14dca2e6426b7885133a (patch)
tree2fac13bbfc7f4dca9c82084925f6b705e8f73bcf /pkg/gui/context
parent830c48f7687cd59609ebc114eda5dff95e24eeb1 (diff)
Use universal resource names to identify itemsshow-sync-status-in-branches-panel-jesse
Refactoring the code to allow for any list item, not just branches/tags, to have an inline status.
Diffstat (limited to 'pkg/gui/context')
-rw-r--r--pkg/gui/context/branches_context.go4
-rw-r--r--pkg/gui/context/tags_context.go4
2 files changed, 2 insertions, 6 deletions
diff --git a/pkg/gui/context/branches_context.go b/pkg/gui/context/branches_context.go
index 16bd58709..68324d020 100644
--- a/pkg/gui/context/branches_context.go
+++ b/pkg/gui/context/branches_context.go
@@ -27,9 +27,7 @@ func NewBranchesContext(c *ContextCommon) *BranchesContext {
getDisplayStrings := func(_ int, _ int) [][]string {
return presentation.GetBranchListDisplayStrings(
viewModel.GetItems(),
- func(branch *models.Branch) types.RefOperation {
- return c.State().GetRefOperation(branch.FullRefName())
- },
+ c.State().GetItemOperation,
c.State().GetRepoState().GetScreenMode() != types.SCREEN_NORMAL,
c.Modes().Diffing.Ref,
c.Tr,
diff --git a/pkg/gui/context/tags_context.go b/pkg/gui/context/tags_context.go
index c9df8c853..3da5a9576 100644
--- a/pkg/gui/context/tags_context.go
+++ b/pkg/gui/context/tags_context.go
@@ -29,9 +29,7 @@ func NewTagsContext(
getDisplayStrings := func(_ int, _ int) [][]string {
return presentation.GetTagListDisplayStrings(
viewModel.GetItems(),
- func(tag *models.Tag) types.RefOperation {
- return c.State().GetRefOperation(tag.FullRefName())
- },
+ c.State().GetItemOperation,
c.Modes().Diffing.Ref, c.Tr)
}