Skip to content

Commit ff526b3

Browse files
authored
SourceControl: attempt to enable long path support for Windows (#6553)
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.
1 parent f353a61 commit ff526b3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/SourceControl/GitRepository.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ public struct GitRepositoryProvider: RepositoryProvider, Cancellable {
163163
"-c", "core.symlinks=true",
164164
// Disable fsmonitor to avoid spawning a monitor process.
165165
"-c", "core.fsmonitor=false",
166+
// Enable long path support on Windows as otherwise we are limited
167+
// to 261 characters in the complete path.
168+
"-c", "core.longpaths=true",
166169
] + options + [origin, destination]
167170

168171
try self.callGit(

0 commit comments

Comments
 (0)