Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(core): Search for Git executable instead of any cmdlet #5979

Closed
wants to merge 1 commit into from

Conversation

MatejKafka
Copy link

Motivation and Context

Before this commit, if a user had a custom alias or function for git specified in their PowerShell profile, Get-HelperPath would return path to the PowerShell module where the function is defined instead of path to the actual Git binary.

How Has This Been Tested?

Tested interactively, the code seems reasonably obvious to me. To test the fix, run the following snippet:

New-Module -Script {function git {}}
scoop update

Without this PR, the invocation results in the folowing error:

> scoop update
&: D:\_custom\scoop\app\apps\scoop\current\lib\core.ps1:273
Line |
 273 |          return & $git @ArgumentList
     |                   ~~~~
     | The term '__DynamicModule_cbe178d9-14c2-494d-8004-fbdc292d59d2' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was
     | included, verify that the path is correct and try again.

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.

@niheaven
Copy link
Member

Please use a branch other than develop and update the changlog.

Before this commit, if a user had a custom alias or function for `git`
specified in their PowerShell profile, `Get-HelperPath` would return
path to the PowerShell module where the function is defined instead
of path to the actual Git binary.
@MatejKafka
Copy link
Author

Please use a branch other than develop and update the changlog.

Added a changelog entry. What branch should I use? The PR guidelines explicitly say to target develop.

@niheaven
Copy link
Member

I mean your local branch. You should create a new branch and make PR from that branch.

@MatejKafka
Copy link
Author

Whatever. #5998

@MatejKafka MatejKafka closed this Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants