@@ -83,7 +83,9 @@ public struct GitRepositoryProvider: RepositoryProvider {
83
83
precondition ( !localFileSystem. exists ( path) )
84
84
85
85
// FIXME: Ideally we should pass `--progress` here and report status regularly. We currently don't have callbacks for that.
86
- try self . callGit ( " clone " , " --mirror " , repository. url, path. pathString,
86
+ //
87
+ // NOTE: Explicitly set `core.symlinks=true` on `git clone` to ensure that symbolic links are correctly resolved.
88
+ try self . callGit ( " clone " , " -c " , " core.symlinks=true " , " --mirror " , repository. url, path. pathString,
87
89
repository: repository,
88
90
failureMessage: " Failed to clone repository \( repository. url) " )
89
91
}
@@ -118,7 +120,9 @@ public struct GitRepositoryProvider: RepositoryProvider {
118
120
// For editable clones, i.e. the user is expected to directly work on them, first we create
119
121
// a clone from our cache of repositories and then we replace the remote to the one originally
120
122
// present in the bare repository.
121
- try self . callGit ( " clone " , " --no-checkout " , sourcePath. pathString, destinationPath. pathString,
123
+ //
124
+ // NOTE: Explicitly set `core.symlinks=true` on `git clone` to ensure that symbolic links are correctly resolved.
125
+ try self . callGit ( " clone " , " -c " , " core.symlinks=true " , " --no-checkout " , sourcePath. pathString, destinationPath. pathString,
122
126
repository: repository,
123
127
failureMessage: " Failed to clone repository \( repository. url) " )
124
128
// The default name of the remote.
@@ -138,7 +142,9 @@ public struct GitRepositoryProvider: RepositoryProvider {
138
142
// re-resolve such that the objects in this repository changed, we would
139
143
// only ever expect to get back a revision that remains present in the
140
144
// object storage.
141
- try self . callGit ( " clone " , " --shared " , " --no-checkout " , sourcePath. pathString, destinationPath. pathString,
145
+ //
146
+ // NOTE: Explicitly set `core.symlinks=true` on `git clone` to ensure that symbolic links are correctly resolved.
147
+ try self . callGit ( " clone " , " -c " , " core.symlinks=true " , " --shared " , " --no-checkout " , sourcePath. pathString, destinationPath. pathString,
142
148
repository: repository,
143
149
failureMessage: " Failed to clone repository \( repository. url) " )
144
150
}
0 commit comments