diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-03-23 18:47:29 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-04-30 13:19:53 +1000 |
commit | db12853bbe825d69686ea71161497d1bbb120b8e (patch) | |
tree | ebfb066dfef8eb75acdc1ea2bd5f15ff4f4a6507 /pkg/gui/controllers/sync_controller.go | |
parent | 711674f6cd68ed3a35e5b0329ff0cf3289fbc7d1 (diff) |
lots of changes
Diffstat (limited to 'pkg/gui/controllers/sync_controller.go')
-rw-r--r-- | pkg/gui/controllers/sync_controller.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/pkg/gui/controllers/sync_controller.go b/pkg/gui/controllers/sync_controller.go index 916266ec0..120d9fdac 100644 --- a/pkg/gui/controllers/sync_controller.go +++ b/pkg/gui/controllers/sync_controller.go @@ -11,17 +11,17 @@ import ( type SyncController struct { baseController - *controllerCommon + c *ControllerCommon } var _ types.IController = &SyncController{} func NewSyncController( - common *controllerCommon, + common *ControllerCommon, ) *SyncController { return &SyncController{ - baseController: baseController{}, - controllerCommon: common, + baseController: baseController{}, + c: common, } } @@ -56,7 +56,7 @@ func (self *SyncController) HandlePull() error { func (self *SyncController) branchCheckedOut(f func(*models.Branch) error) func() error { return func() error { - currentBranch := self.helpers.Refs.GetCheckedOutRef() + currentBranch := self.c.Helpers().Refs.GetCheckedOutRef() if currentBranch == nil { // need to wait for branches to refresh return nil @@ -79,8 +79,8 @@ func (self *SyncController) push(currentBranch *models.Branch) error { if self.c.Git().Config.GetPushToCurrent() { return self.pushAux(pushOpts{setUpstream: true}) } else { - return self.helpers.Upstream.PromptForUpstreamWithInitialContent(currentBranch, func(upstream string) error { - upstreamRemote, upstreamBranch, err := self.helpers.Upstream.ParseUpstream(upstream) + return self.c.Helpers().Upstream.PromptForUpstreamWithInitialContent(currentBranch, func(upstream string) error { + upstreamRemote, upstreamBranch, err := self.c.Helpers().Upstream.ParseUpstream(upstream) if err != nil { return self.c.Error(err) } @@ -100,7 +100,7 @@ func (self *SyncController) pull(currentBranch *models.Branch) error { // if we have no upstream branch we need to set that first if !currentBranch.IsTrackingRemote() { - return self.helpers.Upstream.PromptForUpstreamWithInitialContent(currentBranch, func(upstream string) error { + return self.c.Helpers().Upstream.PromptForUpstreamWithInitialContent(currentBranch, func(upstream string) error { if err := self.setCurrentBranchUpstream(upstream); err != nil { return self.c.Error(err) } @@ -113,7 +113,7 @@ func (self *SyncController) pull(currentBranch *models.Branch) error { } func (self *SyncController) setCurrentBranchUpstream(upstream string) error { - upstreamRemote, upstreamBranch, err := self.helpers.Upstream.ParseUpstream(upstream) + upstreamRemote, upstreamBranch, err := self.c.Helpers().Upstream.ParseUpstream(upstream) if err != nil { return err } @@ -154,7 +154,7 @@ func (self *SyncController) pullWithLock(opts PullFilesOptions) error { }, ) - return self.helpers.MergeAndRebase.CheckMergeOrRebase(err) + return self.c.Helpers().MergeAndRebase.CheckMergeOrRebase(err) } type pushOpts struct { |