1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Remove sub_commits_context's Title method

It implemented this because it wants to do custom truncation of the ref name;
however, we can achieve the same thing by passing the truncated ref name to our
DynamicTitleBuilder, which was previously unused.
This commit is contained in:
Stefan Haller
2023-08-16 08:55:34 +02:00
parent 12f24aa8b4
commit 4de3fadb00
2 changed files with 2 additions and 7 deletions

View File

@ -4,6 +4,7 @@ import (
"github.com/jesseduffield/lazygit/pkg/commands/git_commands"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
)
var _ types.IController = &SwitchToSubCommitsController{}
@ -78,7 +79,7 @@ func (self *SwitchToSubCommitsController) viewCommits() error {
subCommitsContext.SetSelectedLineIdx(0)
subCommitsContext.SetParentContext(self.context)
subCommitsContext.SetWindowName(self.context.GetWindowName())
subCommitsContext.SetTitleRef(ref.Description())
subCommitsContext.SetTitleRef(utils.TruncateWithEllipsis(ref.RefName(), 50))
subCommitsContext.SetRef(ref)
subCommitsContext.SetLimitCommits(true)
subCommitsContext.SetShowBranchHeads(self.context.ShowBranchHeadsInSubCommits())