2022-02-06 06:54:26 +02:00
|
|
|
package controllers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/commands"
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/gui/context"
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers"
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
type controllerCommon struct {
|
2023-03-23 03:35:07 +02:00
|
|
|
c *helpers.HelperCommon
|
2022-02-06 06:54:26 +02:00
|
|
|
helpers *helpers.Helpers
|
|
|
|
contexts *context.ContextTree
|
2023-03-23 03:02:03 +02:00
|
|
|
|
|
|
|
// TODO: use helperCommon's .OS() method instead of this
|
|
|
|
os *oscommands.OSCommand
|
|
|
|
// TODO: use helperCommon's .Git() method instead of this
|
|
|
|
git *commands.GitCommand
|
|
|
|
// TODO: use helperCommon's .Model() method instead of this
|
|
|
|
model *types.Model
|
|
|
|
// TODO: use helperCommon's .Modes() method instead of this
|
|
|
|
modes *types.Modes
|
|
|
|
// TODO: use helperCommon's .Mutexes() method instead of this
|
|
|
|
mutexes *types.Mutexes
|
2022-02-06 06:54:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewControllerCommon(
|
2023-03-23 03:35:07 +02:00
|
|
|
c *helpers.HelperCommon,
|
2022-02-06 06:54:26 +02:00
|
|
|
os *oscommands.OSCommand,
|
|
|
|
git *commands.GitCommand,
|
|
|
|
helpers *helpers.Helpers,
|
|
|
|
model *types.Model,
|
|
|
|
contexts *context.ContextTree,
|
|
|
|
modes *types.Modes,
|
2022-07-31 05:52:56 +02:00
|
|
|
mutexes *types.Mutexes,
|
2022-02-06 06:54:26 +02:00
|
|
|
) *controllerCommon {
|
|
|
|
return &controllerCommon{
|
|
|
|
c: c,
|
|
|
|
os: os,
|
|
|
|
git: git,
|
|
|
|
helpers: helpers,
|
|
|
|
model: model,
|
|
|
|
contexts: contexts,
|
|
|
|
modes: modes,
|
2022-07-31 05:52:56 +02:00
|
|
|
mutexes: mutexes,
|
2022-02-06 06:54:26 +02:00
|
|
|
}
|
|
|
|
}
|