Conversation
Relative paths are compared by the number of their leading .. references and the remaining segments, instead of as plain strings.
This branch has not been deployed
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.
Closes #226.
IsPrefixOfcompared relative paths as strings, which breaks once a path begins with..:A relative path is now split into the number of its leading
..references and the remaining segments:..references: the remaining segments are compared as before (whole-segment, platform-default case sensitivity);..references (..,../.., …); otherwise it names a directory that is only known after resolving the current directory, so the result isfalse;This also covers the empty-path special case from #223, so that branch is folded into the general rule. Absolute paths are compared exactly as before.
Not covered here:
/..on rooted paths (mentioned in the issue). It needs a decision on whether normalization should drop..directly after the root, so I've left it for a separate change.Tests: added cases to
LocalPathTests.IsPrefixOfAndStartsWith; the full suite passes locally.