diff --git a/src/GitTabExpansion.ps1 b/src/GitTabExpansion.ps1 index a9a2a7c12..ea8e2f463 100644 --- a/src/GitTabExpansion.ps1 +++ b/src/GitTabExpansion.ps1 @@ -359,9 +359,12 @@ function GitTabExpansionInternal($lastBlock, $GitStatus = $null) { # Handles git checkout "^(?:checkout).* (?\S*)$" { - gitBranches $matches['ref'] $true - gitRemoteUniqueBranches $matches['ref'] - gitTags $matches['ref'] + & { + gitBranches $matches['ref'] $true + gitRemoteUniqueBranches $matches['ref'] + gitTags $matches['ref'] + # Return only unique branches (to eliminate duplicates where the branch exists locally and on the remote) + } | Select-Object -Unique } # Handles git worktree add