Skip to content

[repo-assist] Skip dot folders (e.g. .localhistory, .git) when scanning for files - #4358

Merged
dsyme merged 1 commit into
masterfrom
repo-assist/fix-issue-3250-skip-dot-folders-4855dac77202eb24
Aug 26, 2026
Merged

dsyme merged 1 commit into
masterfrom
repo-assist/fix-issue-3250-skip-dot-folders-4855dac77202eb24

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 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

FindAllFiles in src/Paket.Core/Common/Utils.fs used DirectoryInfo(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 FindAllFiles as a manual recursive walk that skips any directory whose name starts with .. Callers (NugetConvert.fs's nuget.config/nuget.targets/nuget.exe/*.sln discovery) are unaffected in behavior for normal folder layouts, but no longer descend into dot-folders.

Trade-offs

  • Slightly more code than the one-liner, but avoids adding a dependency.
  • Could theoretically change behavior for someone intentionally storing relevant files inside a dot-folder, but this seems very unlikely to be desired and matches how most tools (e.g. git) already treat dot-folders as special/ignorable.

Test Status

  • ✅ dotnet build src/Paket.Core/Paket.Core.fsproj -f netstandard2.0 — succeeded, 0 errors.
  • ✅ Added new test FindAllFiles should not descend into dot folders in tests/Paket.Tests/UtilsSpecs.fs, which creates a temp folder tree with a .localhistory subfolder containing a decoy .sln file, and asserts it's excluded from FindAllFiles results while a normal nested src/nested.sln is still found.
  • ✅ dotnet test tests/Paket.Tests/Paket.Tests.fsproj -f net9 --filter "FullyQualifiedName~FindAllFiles" — 1/1 passed.
  • i️ Ran the broader UtilsSpecs suite too: 25 passed, 2 skipped (platform-specific), 4 pre-existing failures related to environment-proxy tests (NullReferenceException / stale proxy env var state) — these reproduce on main without this change and are unrelated to this fix.

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@ae8d551f07c7ed7619f8c58c7bb4c3ac89395d38

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
dsyme marked this pull request as ready for review August 26, 2026 16:45
@dsyme
dsyme merged commit d280e94 into master Aug 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't scan the dot folders

1 participant