forked from gitea/gitea
1
0
Fork 0

On windows set core.longpaths true (#8776) (#8786)

This commit is contained in:
zeripath 2019-11-02 11:25:13 +00:00 committed by Jonas Franz
parent 4dac8b2389
commit 646fd8b570
1 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,7 @@ package git
import (
"fmt"
"os/exec"
"runtime"
"strings"
"time"
@ -133,6 +134,13 @@ func Init() error {
return fmt.Errorf("Failed to execute 'git config --global gc.writeCommitGraph true': %s", stderr)
}
}
if runtime.GOOS == "windows" {
if _, stderr, err := process.GetManager().Exec("git.Init(git config --global core.longpaths true)",
GitExecutable, "config", "--global", "core.longpaths", "true"); err != nil {
return fmt.Errorf("Failed to execute 'git config --global core.longpaths true': %s", stderr)
}
}
return nil
}