Skip to content

Compare prefixes ignoring case - #1870

Merged
SimonCropp merged 1 commit into
mainfrom
fix-prefixunique-case
Aug 17, 2026
Merged

Compare prefixes ignoring case#1870
SimonCropp merged 1 commit into
mainfrom
fix-prefixunique-case

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

PrefixUnique kept 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 methods Foo and foo therefore 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.

PrefixUniqueTests covers both directions. Verify.Tests (1301), StaticSettingsTests and Verify.NUnit.Tests pass.

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.
@SimonCropp SimonCropp added this to the 32.0.0 milestone Aug 17, 2026
@SimonCropp
SimonCropp merged commit 26163fb into main Aug 17, 2026
7 checks passed
@SimonCropp
SimonCropp deleted the fix-prefixunique-case branch August 17, 2026 13:18
This was referenced Aug 26, 2026
This was referenced Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant