Compare prefixes ignoring case - #1870
Merged
Merged
Conversation
The prefix set was case sensitive, but the prefix maps to file names and NTFS and APFS are both case insensitive. Test methods Foo and foo passed the uniqueness check and then silently shared one set of snapshot files. A snapshot repository has to work on every platform, so the check now ignores case everywhere rather than only where the filesystem does.
This was referenced Aug 26, 2026
This was referenced Aug 27, 2026
Closed
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.
PrefixUniquekept its set with the default (case sensitive) comparer, but the prefix maps to file names, and NTFS and APFS are both case insensitive. Two test methodsFooandfootherefore passed the uniqueness check and then silently shared one set of snapshot files, each overwriting the other's.The check now ignores case with
StringComparer.OrdinalIgnoreCase.A deliberate call: this applies on every platform, not only where the filesystem is case insensitive. On Linux the two prefixes really are distinct files, so this rejects something that would technically work there. That seems right for a snapshot repository — the files are committed and shared, so a pair that only differs in case is broken for everyone on Windows or macOS, and the failure should surface wherever it is authored rather than only in someone else's checkout. It is also consistent with
VerifyEngine, which already builds its delete set with an ignore-case comparer.DisableRequireUniquePrefix()remains the escape hatch.PrefixUniqueTestscovers both directions.Verify.Tests(1301),StaticSettingsTestsandVerify.NUnit.Testspass.