mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
refactor contexts code
This commit is contained in:
parent
1a74ed3214
commit
138be04e65
60 changed files with 1154 additions and 602 deletions
|
@ -5,7 +5,6 @@ import (
|
|||
"github.com/jesseduffield/lazygit/pkg/commands/models"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/types/enums"
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/popup"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
)
|
||||
|
@ -21,7 +20,7 @@ import (
|
|||
// two user actions, meaning we end up undoing reflog entry C. Redoing works in a similar way.
|
||||
|
||||
type UndoController struct {
|
||||
c *ControllerCommon
|
||||
c *types.ControllerCommon
|
||||
git *commands.GitCommand
|
||||
|
||||
refHelper IRefHelper
|
||||
|
@ -33,7 +32,7 @@ type UndoController struct {
|
|||
var _ types.IController = &UndoController{}
|
||||
|
||||
func NewUndoController(
|
||||
c *ControllerCommon,
|
||||
c *types.ControllerCommon,
|
||||
git *commands.GitCommand,
|
||||
refHelper IRefHelper,
|
||||
workingTreeHelper IWorkingTreeHelper,
|
||||
|
@ -235,7 +234,7 @@ func (self *UndoController) hardResetWithAutoStash(commitSha string, options har
|
|||
dirtyWorkingTree := self.workingTreeHelper.IsWorkingTreeDirty()
|
||||
if dirtyWorkingTree {
|
||||
// offer to autostash changes
|
||||
return self.c.Ask(popup.AskOpts{
|
||||
return self.c.Ask(types.AskOpts{
|
||||
Title: self.c.Tr.AutoStashTitle,
|
||||
Prompt: self.c.Tr.AutoStashPrompt,
|
||||
HandleConfirm: func() error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue