Skip to content

Commit

Permalink
On windows set core.longpaths true (go-gitea#8776)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeripath committed Nov 2, 2019
1 parent 4dac8b2 commit 2b5bf18
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package git
import (
"fmt"
"os/exec"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 2b5bf18

Please sign in to comment.