diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-08 14:00:36 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-09 14:09:53 +1100 |
commit | c9a0cc6b30dca6ff6c520268c10afff4e99a68e9 (patch) | |
tree | 74a03be28aafb5fba5c8391ca611aeb25ca89445 /pkg/gui | |
parent | 3621854dc79baf2064b00b561ebea0ecc8fcb5df (diff) |
refactor
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/branches_panel.go | 8 | ||||
-rw-r--r-- | pkg/gui/dummies.go | 3 | ||||
-rw-r--r-- | pkg/gui/files_panel.go | 6 | ||||
-rw-r--r-- | pkg/gui/global_handlers.go | 6 |
4 files changed, 12 insertions, 11 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index 75186baca..5e0958727 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - "github.com/jesseduffield/lazygit/pkg/commands" + "github.com/jesseduffield/lazygit/pkg/commands/git_commands" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/utils" ) @@ -146,7 +146,7 @@ func (gui *Gui) handleForceCheckout() error { prompt: message, handleConfirm: func() error { gui.logAction(gui.Tr.Actions.ForceCheckoutBranch) - if err := gui.GitCommand.Branch.Checkout(branch.Name, commands.CheckoutOptions{Force: true}); err != nil { + if err := gui.GitCommand.Branch.Checkout(branch.Name, git_commands.CheckoutOptions{Force: true}); err != nil { _ = gui.surfaceError(err) } return gui.refreshSidePanels(refreshOptions{mode: ASYNC}) @@ -166,7 +166,7 @@ func (gui *Gui) handleCheckoutRef(ref string, options handleCheckoutRefOptions) waitingStatus = gui.Tr.CheckingOutStatus } - cmdOptions := commands.CheckoutOptions{Force: false, EnvVars: options.EnvVars} + cmdOptions := git_commands.CheckoutOptions{Force: false, EnvVars: options.EnvVars} onSuccess := func() { gui.State.Panels.Branches.SelectedLineIdx = 0 @@ -335,7 +335,7 @@ func (gui *Gui) mergeBranchIntoCheckedOutBranch(branchName string) error { prompt: prompt, handleConfirm: func() error { gui.logAction(gui.Tr.Actions.Merge) - err := gui.GitCommand.Branch.Merge(branchName, commands.MergeOpts{}) + err := gui.GitCommand.Branch.Merge(branchName, git_commands.MergeOpts{}) return gui.handleGenericMergeCommandResult(err) }, }) diff --git a/pkg/gui/dummies.go b/pkg/gui/dummies.go index 32f032e34..587460ccd 100644 --- a/pkg/gui/dummies.go +++ b/pkg/gui/dummies.go @@ -1,6 +1,7 @@ package gui import ( + "github.com/jesseduffield/lazygit/pkg/commands/git_config" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/updates" @@ -16,6 +17,6 @@ func NewDummyUpdater() *updates.Updater { func NewDummyGui() *Gui { newAppConfig := config.NewDummyAppConfig() - dummyGui, _ := NewGui(utils.NewDummyCommon(), newAppConfig, utils.NewDummyGitConfig(), NewDummyUpdater(), "", false) + dummyGui, _ := NewGui(utils.NewDummyCommon(), newAppConfig, git_config.NewFakeGitConfig(nil), NewDummyUpdater(), "", false) return dummyGui } diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index 045970f05..fa01b6bdf 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/jesseduffield/gocui" - "github.com/jesseduffield/lazygit/pkg/commands" + "github.com/jesseduffield/lazygit/pkg/commands/git_commands" "github.com/jesseduffield/lazygit/pkg/commands/loaders" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/config" @@ -717,7 +717,7 @@ func (gui *Gui) pullWithLock(opts PullFilesOptions) error { gui.logAction(opts.action) err := gui.GitCommand.Sync.Pull( - commands.PullOptions{ + git_commands.PullOptions{ RemoteName: opts.RemoteName, BranchName: opts.BranchName, FastForwardOnly: opts.FastForwardOnly, @@ -742,7 +742,7 @@ func (gui *Gui) push(opts pushOpts) error { } go utils.Safe(func() { gui.logAction(gui.Tr.Actions.Push) - err := gui.GitCommand.Sync.Push(commands.PushOpts{ + err := gui.GitCommand.Sync.Push(git_commands.PushOpts{ Force: opts.force, UpstreamRemote: opts.upstreamRemote, UpstreamBranch: opts.upstreamBranch, diff --git a/pkg/gui/global_handlers.go b/pkg/gui/global_handlers.go index b211baf27..fcd2d30e0 100644 --- a/pkg/gui/global_handlers.go +++ b/pkg/gui/global_handlers.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/jesseduffield/gocui" - "github.com/jesseduffield/lazygit/pkg/commands" + "github.com/jesseduffield/lazygit/pkg/commands/git_commands" "github.com/jesseduffield/lazygit/pkg/utils" ) @@ -215,7 +215,7 @@ func (gui *Gui) fetch() (err error) { defer gui.Mutexes.FetchMutex.Unlock() gui.logAction("Fetch") - err = gui.GitCommand.Sync.Fetch(commands.FetchOptions{}) + err = gui.GitCommand.Sync.Fetch(git_commands.FetchOptions{}) if err != nil && strings.Contains(err.Error(), "exit status 128") { _ = gui.createErrorPanel(gui.Tr.PassUnameWrong) @@ -230,7 +230,7 @@ func (gui *Gui) backgroundFetch() (err error) { gui.Mutexes.FetchMutex.Lock() defer gui.Mutexes.FetchMutex.Unlock() - err = gui.GitCommand.Sync.Fetch(commands.FetchOptions{Background: true}) + err = gui.GitCommand.Sync.Fetch(git_commands.FetchOptions{Background: true}) _ = gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{BRANCHES, COMMITS, REMOTES, TAGS}, mode: ASYNC}) |