From 23de00c29d8b81f3f8b04a5f52ff84302858af8a Mon Sep 17 00:00:00 2001 From: Keith Dahlby Date: Mon, 15 Jan 2018 16:00:59 -0600 Subject: [PATCH] Limit gitbin to a single command --- test/Shared.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Shared.ps1 b/test/Shared.ps1 index 3f897e9e6..fd4da5842 100644 --- a/test/Shared.ps1 +++ b/test/Shared.ps1 @@ -4,11 +4,11 @@ $moduleManifestPath = "$modulePath\posh-git.psd1" $csi = [char]0x1b + "[" if (($PSVersionTable.PSVersion.Major -le 5) -or $IsWindows) { # On Windows, we can access the git binary via git.exe - $global:gitbin = Get-Command -Name git -CommandType Application + $global:gitbin = Get-Command -Name git -CommandType Application -TotalCount 1 } else { # On Linux/macOS, we can access the git binary via its path /usr/bin/git - $global:gitbin = (Get-Command -Name git -CommandType Application).Path + $global:gitbin = (Get-Command -Name git -CommandType Application -TotalCount 1).Path } # We need this or the Git mocks don't work