Skip to content

Commit

Permalink
Avoid calling Path.GetFullPath for already-rooted paths
Browse files Browse the repository at this point in the history
Fixes TestSubFileSystem.TestWatcherCaseSensitive
  • Loading branch information
Metapyziks committed Jun 21, 2024
1 parent 073a020 commit d32ef47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Zio/FileSystems/PhysicalFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ protected override UPath ConvertPathFromInternalImpl(string innerPath)
if (innerPath.StartsWith(@"\\", StringComparison.Ordinal) || innerPath.StartsWith(@"\?", StringComparison.Ordinal))
throw new NotSupportedException($"Path starting with `\\\\` or `\\?` are not supported -> `{innerPath}` ");

var absolutePath = Path.GetFullPath(innerPath);
var absolutePath = Path.IsPathRooted(innerPath) ? innerPath : Path.GetFullPath(innerPath);
var driveIndex = absolutePath.IndexOf(":\\", StringComparison.Ordinal);
if (driveIndex != 1)
throw new ArgumentException($"Expecting a drive for the path `{absolutePath}`");
Expand Down

0 comments on commit d32ef47

Please sign in to comment.