Repository navigation
Drop the "." parent when DirectoryPath's / operators combine [patch] - #540
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
Since #504 the parent of a one-segment relative path, and the directory of a bare file name, is ".". DirectoryPath's four / operators still called Path.Combine, which keeps it, so DirectoryPath("a").Parent / Name was "./a" and FilePath("x.txt").DirectoryPath / FileName was "./x.txt", neither equal to the original. Route them through PooledStringBuilder.CombinePaths, as the Relative* and Absolute* directory types already do. Fixes #539 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW4iaJ7gETqBaPbNzq1
|
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #539
What was wrong
#504 made the parent of a one-segment relative path, and the directory of a bare file name,
"."rather than"". It taughtPooledStringBuilder.CombinePathsto drop a leading".", but the primitiveDirectoryPath's four/operators still calledPath.Combine, andPath.Combine(".", "a")is"./a". As a result:DirectoryPath("a").Parent / Namewas"./a", not equal toDirectoryPath("a")FilePath("x.txt").DirectoryPath / FileNamewas"./x.txt", not equal to the originalWhat changed
DirectoryPath/operators now go throughPooledStringBuilder.CombinePaths, the same asRelativeDirectoryPathandAbsoluteDirectoryPath.DirectoryNameRebuildTests: a single-segmentParent / Nameround trip, a bare-fileDirectoryPath / FileNameround trip, and"." / RelativeFilePathand"." / RelativeDirectoryPath.Testing
Semantics.Teston net10.0 (Linux): 1999 passed, 14 skipped (Windows-only), 0 failed.Generated by Claude Code