Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(core): Limit the number of commands to get #6013

Merged
merged 2 commits into from Jun 13, 2024
Merged

fix(core): Limit the number of commands to get #6013

merged 2 commits into from Jun 13, 2024

Conversation

ghost
Copy link

@ghost ghost commented Jun 13, 2024

Description

When specify -CommandType Application, you get all git commands from $env:Path.
Use TotalCount to limit the number of commands to get.

Motivation and Context

Closes #6012

Relates to #5998

How Has This Been Tested?

Before:

$(Get-Command git -CommandType Application -ErrorAction Ignore).Source
C:\Program Files\Git\cmd\git.exe
C:\Program Files\Git\mingw64\bin\git.exe

After:

$(Get-Command git -CommandType Application -TotalCount 1 -ErrorAction Ignore).Source
C:\Program Files\Git\cmd\git.exe

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant