Skip to content

Commit

Permalink
Specify CommandType as Application
Browse files Browse the repository at this point in the history
Related dahlbyk#478. This is a better fix. By specifying the CommandType as Application we can continue looking for `git` (exe or cmd) but avoiding any potential aliases the user may have created for "git".
  • Loading branch information
mikesigs authored Jul 10, 2017
1 parent 8bfcf1e commit d930e3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GitUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ function Find-Pageant() {
# Attempt to guess $program's location. For ssh-agent/ssh-add.
function Find-Ssh($program = 'ssh-agent') {
Write-Verbose "$program not in path. Trying to guess location."
$gitItem = Get-Command git.exe -Erroraction SilentlyContinue | Get-Item
$gitItem = Get-Command git -CommandType Application -Erroraction SilentlyContinue | Get-Item
if ($null -eq $gitItem) {
Write-Warning 'git not in path'
return
Expand Down

0 comments on commit d930e3b

Please sign in to comment.