aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-11-02 11:25:13 +0000
committerJonas Franz <email@jfdev.de>2019-11-02 12:25:13 +0100
commit646fd8b5704f8bc66fbcc023235c49f91e0f8af3 (patch)
tree05ff6419eebaa34a62707ce93faf20459137ebcf
parent4dac8b2389a6d675eef4a43995cad6e0bbde6a3f (diff)
downloadgitea-646fd8b5704f8bc66fbcc023235c49f91e0f8af3.tar.gz
gitea-646fd8b5704f8bc66fbcc023235c49f91e0f8af3.zip
On windows set core.longpaths true (#8776) (#8786)
-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
}