From: zeripath Date: Sat, 2 Nov 2019 05:40:49 +0000 (+0000) Subject: On windows set core.longpaths true (#8776) X-Git-Tag: v1.11.0-rc1~432 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9d663dfde68f4f3fd6af302aad47439adb1076ae;p=gitea.git On windows set core.longpaths true (#8776) --- diff --git a/modules/git/git.go b/modules/git/git.go index 964760dfda..df50eac72a 100644 --- a/modules/git/git.go +++ b/modules/git/git.go @@ -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 }