Skip to content

Commit

Permalink
Fix duplicated tab completion of branches that exist locally and on t…
Browse files Browse the repository at this point in the history
…he remote (issue
  • Loading branch information
bergmeister authored and dahlbyk committed Dec 14, 2017
1 parent 65658bf commit 4dac43f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/GitTabExpansion.ps1
Expand Up @@ -359,9 +359,11 @@ function GitTabExpansionInternal($lastBlock, $GitStatus = $null) {

# Handles git checkout <ref>
"^(?:checkout).* (?<ref>\S*)$" {
gitBranches $matches['ref'] $true
gitRemoteUniqueBranches $matches['ref']
gitTags $matches['ref']
$script:gitBranches = @(gitBranches $matches['ref'] $true)
$script:gitRemoteUniqueBranches = @(gitRemoteUniqueBranches $matches['ref'])
$script:gitTags = @(gitTags $matches['ref'])
# return only unique branches (to eliminate duplicates where the branch exists locally and on the remote)
$script:gitBranches + $script:gitRemoteUniqueBranches + $script:gitTags | Sort-Object -Unique
}

# Handles git worktree add <path> <ref>
Expand Down

0 comments on commit 4dac43f

Please sign in to comment.