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:
@ -76,7 +76,7 @@ func (self *SyncController) push(currentBranch *models.Branch) error {
|
||||
return self.pushAux(opts)
|
||||
}
|
||||
} else {
|
||||
if self.git.Config.GetPushToCurrent() {
|
||||
if self.c.Git().Config.GetPushToCurrent() {
|
||||
return self.pushAux(pushOpts{setUpstream: true})
|
||||
} else {
|
||||
return self.helpers.Upstream.PromptForUpstreamWithInitialContent(currentBranch, func(upstream string) error {
|
||||
@ -118,7 +118,7 @@ func (self *SyncController) setCurrentBranchUpstream(upstream string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := self.git.Branch.SetCurrentBranchUpstream(upstreamRemote, upstreamBranch); err != nil {
|
||||
if err := self.c.Git().Branch.SetCurrentBranchUpstream(upstreamRemote, upstreamBranch); err != nil {
|
||||
if strings.Contains(err.Error(), "does not exist") {
|
||||
return fmt.Errorf(
|
||||
"upstream branch %s/%s not found.\nIf you expect it to exist, you should fetch (with 'f').\nOtherwise, you should push (with 'shift+P')",
|
||||
@ -146,7 +146,7 @@ func (self *SyncController) PullAux(opts PullFilesOptions) error {
|
||||
func (self *SyncController) pullWithLock(opts PullFilesOptions) error {
|
||||
self.c.LogAction(opts.Action)
|
||||
|
||||
err := self.git.Sync.Pull(
|
||||
err := self.c.Git().Sync.Pull(
|
||||
git_commands.PullOptions{
|
||||
RemoteName: opts.UpstreamRemote,
|
||||
BranchName: opts.UpstreamBranch,
|
||||
@ -167,7 +167,7 @@ type pushOpts struct {
|
||||
func (self *SyncController) pushAux(opts pushOpts) error {
|
||||
return self.c.WithLoaderPanel(self.c.Tr.PushWait, func() error {
|
||||
self.c.LogAction(self.c.Tr.Actions.Push)
|
||||
err := self.git.Sync.Push(git_commands.PushOpts{
|
||||
err := self.c.Git().Sync.Push(git_commands.PushOpts{
|
||||
Force: opts.force,
|
||||
UpstreamRemote: opts.upstreamRemote,
|
||||
UpstreamBranch: opts.upstreamBranch,
|
||||
|
Reference in New Issue
Block a user