From 4ff99f86e5d7da8c7a23e124529fd589b1cbcbb0 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Fri, 1 Nov 2019 22:08:17 +0000 Subject: [PATCH] On windows set core.longpaths true --- modules/git/git.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/git/git.go b/modules/git/git.go index 964760dfda79b..df50eac72a3e7 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 }