This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree 1 file changed +23
-0
lines changed 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,16 @@ string GetLocalClonePathFromGitProvider(string fallbackPath)
257
257
258
258
public void SetDefaultClonePath ( string repositoryPath , UriString cloneUrl )
259
259
{
260
+ if ( ! Splat . ModeDetector . InUnitTestRunner ( ) )
261
+ {
262
+ // Use same capitalization as underlying file system
263
+ if ( DestinationDirectoryExists ( repositoryPath ) )
264
+ {
265
+ var dirInfo = operatingSystem . Directory . GetDirectory ( repositoryPath ) ;
266
+ repositoryPath = GetProperDirectoryCapitalization ( operatingSystem , dirInfo ) ;
267
+ }
268
+ }
269
+
260
270
var ( defaultPath , repositoryLayout ) = RepositoryLayoutUtilities . GetDefaultPathAndLayout ( repositoryPath , cloneUrl ) ;
261
271
262
272
log . Information ( "Setting DefaultRepositoryLocation to {Location}" , defaultPath ) ;
@@ -287,6 +297,19 @@ public string DefaultClonePath
287
297
}
288
298
}
289
299
300
+ static string GetProperDirectoryCapitalization ( IOperatingSystem operatingSystem , IDirectoryInfo dirInfo )
301
+ {
302
+ var parentDirInfo = dirInfo . Parent ;
303
+ if ( parentDirInfo is null )
304
+ {
305
+ return dirInfo . Name ;
306
+ }
307
+
308
+ var parentDir = GetProperDirectoryCapitalization ( operatingSystem , parentDirInfo ) ;
309
+ var dirName = parentDirInfo . EnumerateDirectories ( dirInfo . Name ) . First ( ) . Name ;
310
+ return Path . Combine ( parentDir , dirName ) ;
311
+ }
312
+
290
313
JoinableTaskContext JoinableTaskContext { get ; }
291
314
}
292
315
}
You can’t perform that action at this time.
0 commit comments