diff --git a/scalafmt-tests-community/common/src/main/scala/org/scalafmt/community/common/CommunitySuite.scala b/scalafmt-tests-community/common/src/main/scala/org/scalafmt/community/common/CommunitySuite.scala index ee15e447c6..c2a90c8a8d 100644 --- a/scalafmt-tests-community/common/src/main/scala/org/scalafmt/community/common/CommunitySuite.scala +++ b/scalafmt-tests-community/common/src/main/scala/org/scalafmt/community/common/CommunitySuite.scala @@ -87,15 +87,14 @@ 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 (OsSpecific.isWindows) + runCmd(s"git -C $folder config core.longpaths true", "setting long paths") + val ref = build.commit runCmd(s"git -C $folder fetch --depth=1 origin $ref", s"fetching [ref=$ref]")