1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

Centralize logic regarding WorkingTreeState close to its definition

This commit is contained in:
Stefan Haller
2024-06-11 12:05:42 +02:00
parent cd36e95a82
commit b210b4363d
6 changed files with 52 additions and 64 deletions

View File

@ -5,7 +5,6 @@ import (
"strings"
"github.com/jesseduffield/lazygit/pkg/commands/types/enums"
"github.com/jesseduffield/lazygit/pkg/gui/presentation"
"github.com/jesseduffield/lazygit/pkg/gui/style"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/samber/lo"
@ -121,7 +120,7 @@ func (self *ModeHelper) Statuses() []ModeStatus {
Description: func() string {
workingTreeState := self.c.Git().Status.WorkingTreeState()
return self.withResetButton(
presentation.FormatWorkingTreeStateTitle(self.c.Tr, workingTreeState), style.FgYellow,
workingTreeState.Title(self.c.Tr), style.FgYellow,
)
},
Reset: self.mergeAndRebaseHelper.AbortMergeOrRebaseWithConfirm,