1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

split context common from helper common

This commit is contained in:
Jesse Duffield
2023-03-23 12:35:07 +11:00
parent f081358943
commit 43251e7275
55 changed files with 156 additions and 133 deletions

View File

@ -1,23 +1,15 @@
package helpers
import (
"github.com/jesseduffield/lazygit/pkg/commands"
"github.com/jesseduffield/lazygit/pkg/gui/types"
)
type BisectHelper struct {
c *types.HelperCommon
git *commands.GitCommand
c *HelperCommon
}
func NewBisectHelper(
c *types.HelperCommon,
git *commands.GitCommand,
) *BisectHelper {
return &BisectHelper{
c: c,
git: git,
}
func NewBisectHelper(c *HelperCommon) *BisectHelper {
return &BisectHelper{c: c}
}
func (self *BisectHelper) Reset() error {
@ -26,7 +18,7 @@ func (self *BisectHelper) Reset() error {
Prompt: self.c.Tr.Bisect.ResetPrompt,
HandleConfirm: func() error {
self.c.LogAction(self.c.Tr.Actions.ResetBisect)
if err := self.git.Bisect.Reset(); err != nil {
if err := self.c.Git().Bisect.Reset(); err != nil {
return self.c.Error(err)
}