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

Cleanup: remove unused log parameter of patch_exploring.NewState

This commit is contained in:
Stefan Haller
2024-10-16 14:25:38 +02:00
parent 2f1564d288
commit da47498066
3 changed files with 4 additions and 5 deletions

View File

@ -91,7 +91,7 @@ func (self *PatchBuildingHelper) RefreshPatchBuildingPanel(opts types.OnFocusOpt
oldState := context.GetState()
state := patch_exploring.NewState(diff, selectedLineIdx, oldState, self.c.Log)
state := patch_exploring.NewState(diff, selectedLineIdx, oldState)
context.SetState(state)
if state == nil {
self.Escape()

View File

@ -63,11 +63,11 @@ func (self *StagingHelper) RefreshStagingPanel(focusOpts types.OnFocusOpts) {
secondaryContext.GetMutex().Lock()
mainContext.SetState(
patch_exploring.NewState(mainDiff, mainSelectedLineIdx, mainContext.GetState(), self.c.Log),
patch_exploring.NewState(mainDiff, mainSelectedLineIdx, mainContext.GetState()),
)
secondaryContext.SetState(
patch_exploring.NewState(secondaryDiff, secondarySelectedLineIdx, secondaryContext.GetState(), self.c.Log),
patch_exploring.NewState(secondaryDiff, secondarySelectedLineIdx, secondaryContext.GetState()),
)
mainState := mainContext.GetState()

View File

@ -3,7 +3,6 @@ package patch_exploring
import (
"github.com/jesseduffield/generics/set"
"github.com/jesseduffield/lazygit/pkg/commands/patch"
"github.com/sirupsen/logrus"
)
// State represents the current state of the patch explorer context i.e. when
@ -29,7 +28,7 @@ const (
HUNK
)
func NewState(diff string, selectedLineIdx int, oldState *State, log *logrus.Entry) *State {
func NewState(diff string, selectedLineIdx int, oldState *State) *State {
if oldState != nil && diff == oldState.diff && selectedLineIdx == -1 {
// if we're here then we can return the old state. If selectedLineIdx was not -1
// then that would mean we were trying to click and potentiall drag a range, which