diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-03-23 13:04:57 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-04-30 13:19:53 +1000 |
commit | 711674f6cd68ed3a35e5b0329ff0cf3289fbc7d1 (patch) | |
tree | 965c3503390213b1a7d1fb3737a9712b3af86550 /pkg/gui/controllers/sync_controller.go | |
parent | fc91ef6a59e3cf8336b1cef78c210907c08a4cda (diff) |
standardise controller helper methods
Diffstat (limited to 'pkg/gui/controllers/sync_controller.go')
-rw-r--r-- | pkg/gui/controllers/sync_controller.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/gui/controllers/sync_controller.go b/pkg/gui/controllers/sync_controller.go index 5add485c4..916266ec0 100644 --- a/pkg/gui/controllers/sync_controller.go +++ b/pkg/gui/controllers/sync_controller.go @@ -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, |