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

standardise controller helper methods

This commit is contained in:
Jesse Duffield
2023-03-23 13:04:57 +11:00
parent fc91ef6a59
commit 711674f6cd
34 changed files with 262 additions and 297 deletions

View File

@ -57,10 +57,10 @@ func (self *SwitchToSubCommitsController) viewCommits() error {
}
// need to populate my sub commits
commits, err := self.git.Loaders.CommitLoader.GetCommits(
commits, err := self.c.Git().Loaders.CommitLoader.GetCommits(
git_commands.GetCommitsOptions{
Limit: true,
FilterPath: self.modes.Filtering.GetPath(),
FilterPath: self.c.Modes().Filtering.GetPath(),
IncludeRebaseCommits: false,
RefName: ref.FullRefName(),
},
@ -71,19 +71,19 @@ func (self *SwitchToSubCommitsController) viewCommits() error {
self.setSubCommits(commits)
self.contexts.SubCommits.SetSelectedLineIdx(0)
self.contexts.SubCommits.SetParentContext(self.context)
self.contexts.SubCommits.SetWindowName(self.context.GetWindowName())
self.contexts.SubCommits.SetTitleRef(ref.Description())
self.contexts.SubCommits.SetRef(ref)
self.contexts.SubCommits.SetLimitCommits(true)
self.c.Contexts().SubCommits.SetSelectedLineIdx(0)
self.c.Contexts().SubCommits.SetParentContext(self.context)
self.c.Contexts().SubCommits.SetWindowName(self.context.GetWindowName())
self.c.Contexts().SubCommits.SetTitleRef(ref.Description())
self.c.Contexts().SubCommits.SetRef(ref)
self.c.Contexts().SubCommits.SetLimitCommits(true)
err = self.c.PostRefreshUpdate(self.contexts.SubCommits)
err = self.c.PostRefreshUpdate(self.c.Contexts().SubCommits)
if err != nil {
return err
}
return self.c.PushContext(self.contexts.SubCommits)
return self.c.PushContext(self.c.Contexts().SubCommits)
}
func (self *SwitchToSubCommitsController) Context() types.Context {