Skip to content

Commit 2b5bf18

Browse files
committed
On windows set core.longpaths true (go-gitea#8776)
1 parent 4dac8b2 commit 2b5bf18

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

modules/git/git.go

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package git
88
import (
99
"fmt"
1010
"os/exec"
11+
"runtime"
1112
"strings"
1213
"time"
1314

@@ -133,6 +134,13 @@ func Init() error {
133134
return fmt.Errorf("Failed to execute 'git config --global gc.writeCommitGraph true': %s", stderr)
134135
}
135136
}
137+
138+
if runtime.GOOS == "windows" {
139+
if _, stderr, err := process.GetManager().Exec("git.Init(git config --global core.longpaths true)",
140+
GitExecutable, "config", "--global", "core.longpaths", "true"); err != nil {
141+
return fmt.Errorf("Failed to execute 'git config --global core.longpaths true': %s", stderr)
142+
}
143+
}
136144
return nil
137145
}
138146

0 commit comments

Comments
 (0)