1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +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

@ -111,7 +111,7 @@ func (self *StatusController) onClick(opts gocui.ViewMouseBindingOpts) error {
workingTreeState := self.c.Git().Status.WorkingTreeState()
switch workingTreeState {
case enums.WORKING_TREE_STATE_REBASING, enums.WORKING_TREE_STATE_MERGING:
workingTreeStatus := fmt.Sprintf("(%s)", presentation.FormatWorkingTreeStateLower(self.c.Tr, workingTreeState))
workingTreeStatus := fmt.Sprintf("(%s)", workingTreeState.LowerCaseTitle(self.c.Tr))
if cursorInSubstring(opts.X, upstreamStatus+" ", workingTreeStatus) {
return self.c.Helpers().MergeAndRebase.CreateRebaseOptionsMenu()
}