mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-17 00:18:05 +02:00
simplify
This commit is contained in:
@ -296,10 +296,8 @@ func (app *App) KnownError(err error) (string, bool) {
|
|||||||
|
|
||||||
knownErrorMessages := []string{app.Tr.MinGitVersionError}
|
knownErrorMessages := []string{app.Tr.MinGitVersionError}
|
||||||
|
|
||||||
if message, ok := slices.Find(knownErrorMessages, func(knownErrorMessage string) bool {
|
if slices.Contains(knownErrorMessages, errorMessage) {
|
||||||
return knownErrorMessage == errorMessage
|
return errorMessage, true
|
||||||
}); ok {
|
|
||||||
return message, true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mappings := []errorMapping{
|
mappings := []errorMapping{
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
package git_commands
|
package git_commands
|
||||||
|
|
||||||
import "github.com/sirupsen/logrus"
|
import (
|
||||||
|
"github.com/jesseduffield/generics/maps"
|
||||||
|
"github.com/jesseduffield/generics/slices"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
// although the typical terms in a git bisect are 'bad' and 'good', they're more
|
// although the typical terms in a git bisect are 'bad' and 'good', they're more
|
||||||
// generally known as 'new' and 'old'. Semi-recently git allowed the user to define
|
// generally known as 'new' and 'old'. Semi-recently git allowed the user to define
|
||||||
@ -93,11 +97,5 @@ func (self *BisectInfo) Bisecting() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, status := range self.statusMap {
|
return slices.Contains(maps.Values(self.statusMap), BisectStatusOld)
|
||||||
if status == BisectStatusOld {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user