]> source.dussan.org Git - gitea.git/commitdiff
On windows set core.longpaths true (#8776)
authorzeripath <art27@cantab.net>
Sat, 2 Nov 2019 05:40:49 +0000 (05:40 +0000)
committerLunny Xiao <xiaolunwen@gmail.com>
Sat, 2 Nov 2019 05:40:49 +0000 (13:40 +0800)
modules/git/git.go

index 964760dfda79be0cd8bc188ce5d142548e3082d9..df50eac72a3e7dd32fe5b189e14f7f25f35b896e 100644 (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
 }