From d32ef47e4adf9192cd52d0762002072c9df9070c Mon Sep 17 00:00:00 2001 From: James King Date: Fri, 21 Jun 2024 11:12:03 +0100 Subject: [PATCH] Avoid calling Path.GetFullPath for already-rooted paths Fixes TestSubFileSystem.TestWatcherCaseSensitive --- src/Zio/FileSystems/PhysicalFileSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Zio/FileSystems/PhysicalFileSystem.cs b/src/Zio/FileSystems/PhysicalFileSystem.cs index 1b1164b..ffc659f 100644 --- a/src/Zio/FileSystems/PhysicalFileSystem.cs +++ b/src/Zio/FileSystems/PhysicalFileSystem.cs @@ -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}`");