summaryrefslogtreecommitdiffstats
path: root/pkg/gui/context/sub_commits_context.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/context/sub_commits_context.go')
-rw-r--r--pkg/gui/context/sub_commits_context.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/pkg/gui/context/sub_commits_context.go b/pkg/gui/context/sub_commits_context.go
index 1a606ac91..2af3fc4cc 100644
--- a/pkg/gui/context/sub_commits_context.go
+++ b/pkg/gui/context/sub_commits_context.go
@@ -51,10 +51,14 @@ func NewSubCommitsContext(
selectedCommitSha = selectedCommit.Sha
}
}
+ branches := []*models.Branch{}
+ if viewModel.GetShowBranchHeads() {
+ branches = c.Model().Branches
+ }
return presentation.GetCommitListDisplayStrings(
c.Common,
c.Model().SubCommits,
- c.Model().Branches,
+ branches,
viewModel.GetRef().RefName(),
c.State().GetRepoState().GetScreenMode() != types.SCREEN_NORMAL,
c.Modes().CherryPicking.SelectedShaSet(),
@@ -106,7 +110,8 @@ type SubCommitsViewModel struct {
ref types.Ref
*ListViewModel[*models.Commit]
- limitCommits bool
+ limitCommits bool
+ showBranchHeads bool
}
func (self *SubCommitsViewModel) SetRef(ref types.Ref) {
@@ -117,6 +122,14 @@ func (self *SubCommitsViewModel) GetRef() types.Ref {
return self.ref
}
+func (self *SubCommitsViewModel) SetShowBranchHeads(value bool) {
+ self.showBranchHeads = value
+}
+
+func (self *SubCommitsViewModel) GetShowBranchHeads() bool {
+ return self.showBranchHeads
+}
+
func (self *SubCommitsContext) GetSelectedItemId() string {
item := self.GetSelected()
if item == nil {