Skip to content

Refuse a root that is, or lies inside, a CVS or _darcs folder [patch] - #216

Open
matt-edmondson wants to merge 1 commit into
mainfrom
fix/vcs-root-case-sensitive-215
Open

matt-edmondson wants to merge 1 commit into
mainfrom
fix/vcs-root-case-sensitive-215

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #215

What was wrong

#208 made every verb refuse a root that is, or lies inside, version-control metadata. But FileScanner.FindVersionControlMetadata checked only VersionControlDirectories, the case-insensitive set. #213 had already moved CVS and _darcs into CaseSensitiveVersionControlDirectories, so the root check never saw them. As a result, -p proj/CVS or -p proj/_darcs/patches was scanned, and Deduplicate could delete byte-identical metadata files there. The same folders one level below the root were skipped, because the walk uses IsVersionControlDirectoryName, which checks both sets.

Change

FindVersionControlMetadata now uses IsVersionControlDirectoryName(current.Name), the same test the walk uses. CVS and _darcs are refused as roots. Other spellings (cvs, Cvs, _DARCS) are still ordinary folders, as #211 requires. The method's remarks note this.

Tests

  • EveryVerbRefusesARootThatIsOrLiesInsideVersionControlMetadata has two new rows, proj/CVS and proj/_darcs/patches, with matching identical files. All four verbs must exit 1, say why, and delete nothing.
  • New: ARootNamedLikeCaseSensitiveMetadataInAnotherCaseIsStillScanned covers cvs, Cvs and _DARCS. It keeps A user folder named cvs, Cvs or _DARCS is silently left out of the scan: the VCS skip list ignores case #211's rule pinned at the root.
  • Without the fix, the two new rows fail ("Scan did not fail"), matching the issue. The other-case rows pass either way, as a guard.
  • Full suite on Linux / .NET 10: 181 total, 178 passed, 0 failed (3 skipped).

Generated by Claude Code

FindVersionControlMetadata checked only the case-insensitive set of
metadata names, so after #213 moved CVS and _darcs into the case-sensitive
set, a root at or under them was scanned and deduplicated while the same
folder below the root was skipped. Use IsVersionControlDirectoryName, as
the walk does.

Fixes #215

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW3u8Ga41rqFWd6Sy25
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A root that is, or lies inside, a CVS or _darcs folder is still scanned and deduplicated: #208's root check skips the case-sensitive VCS names

2 participants