Repository navigation
[repo-assist] Skip dot folders (e.g. .localhistory, .git) when scanning for files - #4358
Merged
dsyme merged 1 commit intoAug 26, 2026
Conversation
FindAllFiles previously used SearchOption.AllDirectories which recurses into every subfolder including dot-folders such as .git, .vs, or .localhistory. This can be slow and can pick up unwanted backup/history copies of solution files, causing incorrect scan results (e.g. paket attempting to process stray .sln backups). Fixes #3250 Co-authored-by: Copilot <[email protected]>
dsyme
marked this pull request as ready for review
August 26, 2026 16:45
This was referenced Oct 5, 2026
This was referenced Oct 14, 2026
This was referenced Nov 11, 2026
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.
🤖 This PR was created by Repo Assist, an automated AI assistant. It has not been reviewed by a human maintainer yet.
Closes #3250
Root cause
FindAllFilesinsrc/Paket.Core/Common/Utils.fsusedDirectoryInfo(folder).GetFiles(pattern, SearchOption.AllDirectories), which recurses into every subfolder without exception — including dot-folders like.git,.vs,.localhistory, etc. As reported in #3250, this causes Paket to pick up stray backup copies of solution files (and potentially other unwanted content) from tooling/editor metadata folders.Fix
Reimplemented
FindAllFilesas a manual recursive walk that skips any directory whose name starts with.. Callers (NugetConvert.fs'snuget.config/nuget.targets/nuget.exe/*.slndiscovery) are unaffected in behavior for normal folder layouts, but no longer descend into dot-folders.Trade-offs
Test Status
dotnet build src/Paket.Core/Paket.Core.fsproj -f netstandard2.0— succeeded, 0 errors.FindAllFiles should not descend into dot foldersintests/Paket.Tests/UtilsSpecs.fs, which creates a temp folder tree with a.localhistorysubfolder containing a decoy.slnfile, and asserts it's excluded fromFindAllFilesresults while a normal nestedsrc/nested.slnis still found.dotnet test tests/Paket.Tests/Paket.Tests.fsproj -f net9 --filter "FullyQualifiedName~FindAllFiles"— 1/1 passed.UtilsSpecssuite too: 25 passed, 2 skipped (platform-specific), 4 pre-existing failures related to environment-proxy tests (NullReferenceException/ stale proxy env var state) — these reproduce onmainwithout this change and are unrelated to this fix.Add this agentic workflow to your repo
To install this agentic workflow, run