From 37876d9492a60d63b9545da6d9af7bfef081e9a0 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Sat, 13 May 2023 12:21:42 -0700 Subject: [PATCH] SourceControl: attempt to enable long path support for Windows Windows paths are limited to 261 characters by default. Git provides the `core.longpaths` option to use the extended path support. This should make SPM more reliable on Windows. --- Sources/SourceControl/GitRepository.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/SourceControl/GitRepository.swift b/Sources/SourceControl/GitRepository.swift index ec46afe12c2..753ab175f3c 100644 --- a/Sources/SourceControl/GitRepository.swift +++ b/Sources/SourceControl/GitRepository.swift @@ -163,6 +163,9 @@ public struct GitRepositoryProvider: RepositoryProvider, Cancellable { "-c", "core.symlinks=true", // Disable fsmonitor to avoid spawning a monitor process. "-c", "core.fsmonitor=false", + // Enable long path support on Windows as otherwise we are limited + // to 261 characters in the complete path. + "-c", "core.longpaths=true", ] + options + [origin, destination] try self.callGit(