fix: slow git status on wsl2

This commit is contained in:
evilz 2021-03-10 18:42:24 +01:00 committed by Jan De Dobbeleer
parent 6ed5402ef6
commit 500cc5834d

View file

@ -272,7 +272,7 @@ func (g *git) getStatusColor(defaultValue string) string {
func (g *git) getGitCommandOutput(args ...string) string {
gitCommand := "git"
if g.env.getRuntimeGOOS() == windowsPlatform {
if g.env.getRuntimeGOOS() == windowsPlatform || (g.env.isWsl() && strings.HasPrefix(g.env.getcwd(), "/mnt/")) {
gitCommand = "git.exe"
}
args = append([]string{"--no-optional-locks", "-c", "core.quotepath=false", "-c", "color.status=false"}, args...)