1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-25 22:32:13 +02:00

standardise helper args

This commit is contained in:
Jesse Duffield
2023-03-23 12:53:18 +11:00
parent 43251e7275
commit fc91ef6a59
19 changed files with 197 additions and 323 deletions

View File

@@ -9,8 +9,7 @@ import (
)
type UpstreamHelper struct {
c *HelperCommon
model *types.Model
c *HelperCommon
getRemoteBranchesSuggestionsFunc func(string) func(string) []*types.Suggestion
}
@@ -26,12 +25,10 @@ var _ IUpstreamHelper = &UpstreamHelper{}
func NewUpstreamHelper(
c *HelperCommon,
model *types.Model,
getRemoteBranchesSuggestionsFunc func(string) func(string) []*types.Suggestion,
) *UpstreamHelper {
return &UpstreamHelper{
c: c,
model: model,
getRemoteBranchesSuggestionsFunc: getRemoteBranchesSuggestionsFunc,
}
}
@@ -70,7 +67,7 @@ func (self *UpstreamHelper) PromptForUpstreamWithoutInitialContent(_ *models.Bra
}
func (self *UpstreamHelper) GetSuggestedRemote() string {
return getSuggestedRemote(self.model.Remotes)
return getSuggestedRemote(self.c.Model().Remotes)
}
func getSuggestedRemote(remotes []*models.Remote) string {