Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Limit search pattern and directory recursion - #4647

#4647
Merged
arturcic merged 1 commit into
GitTools:mainGitTools/GitVersion:mainfrom
asbjornu:gh-4411-enumerate-filesasbjornu/GitVersion:gh-4411-enumerate-filesCopy head branch name to clipboard
Aug 9, 2025
Merged

Limit search pattern and directory recursion#4647
arturcic merged 1 commit into
GitTools:mainGitTools/GitVersion:mainfrom
asbjornu:gh-4411-enumerate-filesasbjornu/GitVersion:gh-4411-enumerate-filesCopy head branch name to clipboard

Conversation

@asbjornu

@asbjornu asbjornu commented Aug 8, 2025

Copy link
Copy Markdown
Member

Description

Narrow the scope of the search pattern to only include project files and limit directory recursion to 255 subdirectories to avoid infinite loops and subsequent PathTooLongException.

Related Issue

May fix GH-4411.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copilot AI review requested due to automatic review settings August 8, 2025 23:10
@asbjornu asbjornu added this to the 6.x milestone Aug 8, 2025

This comment was marked as outdated.

@asbjornu
asbjornu force-pushed the gh-4411-enumerate-files branch 2 times, most recently from da62f4a to 86ca875 Compare August 8, 2025 23:13
@asbjornu
asbjornu requested a review from Copilot August 8, 2025 23:14
@asbjornu asbjornu assigned arturcic and unassigned arturcic Aug 8, 2025

This comment was marked as outdated.

@asbjornu
asbjornu requested a review from arturcic August 8, 2025 23:14
@asbjornu
asbjornu force-pushed the gh-4411-enumerate-files branch from 86ca875 to 3693ec5 Compare August 8, 2025 23:16
@asbjornu
asbjornu requested a review from Copilot August 8, 2025 23:16

This comment was marked as outdated.

@asbjornu
asbjornu requested a review from Copilot August 8, 2025 23:20

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the project file discovery mechanism by limiting the scope and depth of directory traversal to prevent infinite loops and PathTooLongException errors. The changes specifically target scenarios where directory recursion could become problematic.

  • Introduces a maximum recursion depth limit of 255 subdirectories
  • Narrows the search pattern from "*" to "*proj" to focus on actual project files
  • Replaces the legacy SearchOption.AllDirectories with modern EnumerationOptions

Comment thread src/GitVersion.Output/AssemblyInfo/ProjectFileUpdater.cs
Comment thread src/GitVersion.Output/AssemblyInfo/ProjectFileUpdater.cs
Narrow the scope of the search pattern to only include project files and
limit directory recursion to 255 subdirectories to avoid infinite loops
and subsequent `PathTooLongException`. May fix GitToolsGH-4411.
@arturcic
arturcic force-pushed the gh-4411-enumerate-files branch from f37a27d to b857ada Compare August 9, 2025 19:09
@sonarqubecloud

sonarqubecloud Bot commented Aug 9, 2025

Copy link
Copy Markdown

@arturcic
arturcic enabled auto-merge August 9, 2025 19:14
@arturcic
arturcic merged commit d145da0 into GitTools:main Aug 9, 2025
85 checks passed
@mergify

mergify Bot commented Aug 9, 2025

Copy link
Copy Markdown
Contributor

Thank you @asbjornu for your contribution!

@arturcic arturcic modified the milestones: 6.x, 6.4.0 Aug 9, 2025
@gittools-bot

Copy link
Copy Markdown
Contributor

🎉 This issue has been resolved in version 6.4.0 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

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.

[ISSUE]: Recursing symlinks infinitely - PathTooLongException

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.