Skip to content

Commit

Permalink
CommunitySuite: set longpaths in clone directory
Browse files Browse the repository at this point in the history
This avoids race conditions when global config is locked by another.
  • Loading branch information
kitbellew committed Oct 1, 2024
1 parent 554dc2d commit 5ffebe9
Showing 1 changed file with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,21 @@ abstract class CommunitySuite extends FunSuite {
val folderPath = communityProjectsDirectory.resolve(build.name)
val folder = folderPath.toString

if (OsSpecific.isWindows)
if (0 != runCmdRaw("git config --global core.longpaths true"))
runCmd("git config --system core.longpaths true", "setting long paths")

if (!Files.exists(folderPath)) runCmd(
s"git clone --depth=1 --no-single-branch ${build.giturl} $folder",
"cloning",
)
if (!Files.exists(folderPath)) // clone
if (OsSpecific.isWindows) {
runCmd(s"git init $folder", "running init")
runCmd(
s"git -C $folder config core.longpaths true",
"setting long paths",
)
runCmd(
s"git -C $folder remote add origin ${build.giturl}",
"adding origin",
)
} else runCmd(
s"git clone --depth=1 --no-single-branch ${build.giturl} $folder",
"cloning",
)

val ref = build.commit

Expand Down

0 comments on commit 5ffebe9

Please sign in to comment.