aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-11-02 05:40:49 +0000
committerLunny Xiao <xiaolunwen@gmail.com>2019-11-02 13:40:49 +0800
commit9d663dfde68f4f3fd6af302aad47439adb1076ae (patch)
tree5a25bc544e80e5d08a16326f156cc2b99e72cbfc
parent8f26397928b33a16558dafc2716a72b6e6900bf4 (diff)
downloadgitea-9d663dfde68f4f3fd6af302aad47439adb1076ae.tar.gz
gitea-9d663dfde68f4f3fd6af302aad47439adb1076ae.zip
On windows set core.longpaths true (#8776)
-rw-r--r--modules/git/git.go8
1 files changed, 8 insertions, 0 deletions
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
}