diff --git a/pkg/gui/context/sub_commits_context.go b/pkg/gui/context/sub_commits_context.go index 43cc513c0..b9b3a91b0 100644 --- a/pkg/gui/context/sub_commits_context.go +++ b/pkg/gui/context/sub_commits_context.go @@ -1,14 +1,12 @@ package context import ( - "fmt" "time" "github.com/jesseduffield/lazygit/pkg/commands/git_commands" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/gui/presentation" "github.com/jesseduffield/lazygit/pkg/gui/types" - "github.com/jesseduffield/lazygit/pkg/utils" ) type SubCommitsContext struct { @@ -160,10 +158,6 @@ func (self *SubCommitsContext) GetCommits() []*models.Commit { return self.getModel() } -func (self *SubCommitsContext) Title() string { - return fmt.Sprintf(self.c.Tr.SubCommitsDynamicTitle, utils.TruncateWithEllipsis(self.ref.RefName(), 50)) -} - func (self *SubCommitsContext) SetLimitCommits(value bool) { self.limitCommits = value } diff --git a/pkg/gui/controllers/switch_to_sub_commits_controller.go b/pkg/gui/controllers/switch_to_sub_commits_controller.go index 5b86854ca..a2b25efbb 100644 --- a/pkg/gui/controllers/switch_to_sub_commits_controller.go +++ b/pkg/gui/controllers/switch_to_sub_commits_controller.go @@ -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())