This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 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)
257257
258258 public void SetDefaultClonePath ( string repositoryPath , UriString cloneUrl )
259259 {
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+
260270 var ( defaultPath , repositoryLayout ) = RepositoryLayoutUtilities . GetDefaultPathAndLayout ( repositoryPath , cloneUrl ) ;
261271
262272 log . Information ( "Setting DefaultRepositoryLocation to {Location}" , defaultPath ) ;
@@ -287,6 +297,19 @@ public string DefaultClonePath
287297 }
288298 }
289299
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+
290313 JoinableTaskContext JoinableTaskContext { get ; }
291314 }
292315}
You can’t perform that action at this time.
0 commit comments