Repository navigation
Skip .git, .svn, .hg and .bzr directories when scanning [patch] - #194
Merged
Merged
Conversation
Inside .git, every branch ref pointing at the same commit has identical content, as do the reflogs of branches created together. The scan walked into .git like any other folder, so Deduplicate grouped those files as duplicates and deleted all but one, deleting branches and their reflogs in every repository under the root. The walk now prunes version-control metadata directories by name, so their contents are never scanned, reported or deleted. A .git file (a worktree or submodule pointer) and directories such as .github are still scanned. The README notes the exclusion next to the empty-file rule. Fixes #192 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW34mg5yez39UfTV7yf
|
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 #192
What changes
Inside
.git, every branch ref that points at the same commit has identical content, and so do the reflogs of branches created together.FileScanner.ScanForFileswalked into.gitlike any other folder. Deduplicate then grouped those files as duplicates and deleted all but one, which deleted branches and their reflogs in every repository under the root.FileScannernow walks with aFileSystemEnumerablewhoseShouldRecursePredicateprunes directories named.git,.svn,.hgor.bzr. The name match ignores case, and the walk keeps the sameWalkOptions. This is a directory filter on the enumeration, not a substring match on paths: a.gitfile (a worktree or submodule pointer),.github/andmirror.git/are still scanned.Tests
The new
VersionControlMetadataTests:.GITspelling) and keeps the file outside them..gitfile,.github/,mirror.git/and.gitignore.Deduplicate(confirmed withy) deletes the real duplicate outside.gitand leaves every ref and reflog in place.ScanandDryRunreport the real duplicate and nothing inside.git.With the scanner change reverted, 7 of the 8 fail. The look-alike guard passes either way, which is intended. Full suite: 114 passed, 3 skipped (the same 3 are skipped on
main), 0 failed.The same bug is open in KtsuTools as ktsu-dev/KtsuTools#222. It isn't touched here.
Generated by Claude Code