diff --git a/PSGitUtils/PSGitUtils.psd1 b/PSGitUtils/PSGitUtils.psd1 index 2e074c3..6af6dde 100644 --- a/PSGitUtils/PSGitUtils.psd1 +++ b/PSGitUtils/PSGitUtils.psd1 @@ -12,7 +12,7 @@ RootModule = 'PSGitUtils.psm1' # Version number of this module. - ModuleVersion = '1.15.0' + ModuleVersion = '1.15.1' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PSGitUtils/PSGitUtils.psm1 b/PSGitUtils/PSGitUtils.psm1 index 55e4ed9..25483dc 100644 --- a/PSGitUtils/PSGitUtils.psm1 +++ b/PSGitUtils/PSGitUtils.psm1 @@ -329,18 +329,18 @@ function Invoke-GitCheckout { git checkout $branch } } - # Invoke-GitCheckout -s key - elseif ($args.Count -eq 2 -and $args[0] -eq "-s") { - [string]$pattern = $args[1] - $branch = Get-OptionsForChoosingLocalOrOriginBranch "Switch branch" "Please choose a branch to switch" $pattern + else { + $res = git checkout $args + if($res -eq $null) { + Write-Host "Unable to switch to branch $($args[0]), trying to search by matching operators..." -ForegroundColor Blue - if ($branch) { - git checkout $branch + $branch = Get-OptionsForChoosingLocalOrOriginBranch "Switch branch" "Please choose a branch to switch" $args[0] + + if ($branch) { + git checkout $branch + } } } - else { - git checkout $args - } } ## list origin branches