Skip to content

Commit

Permalink
Merge pull request #805 from wallybh/plus-sign
Browse files Browse the repository at this point in the history
Fix tab completion of branches in different worktrees
  • Loading branch information
dahlbyk committed Oct 26, 2020
2 parents 4bb8d81 + 00f18c9 commit c7f084e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/GitTabExpansion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function script:gitBranches($filter, $includeHEAD = $false, $prefix = '') {
$filter = $matches['to']
}

$branches = @(git branch --no-color | ForEach-Object { if (($_ -notmatch "^\* \(HEAD detached .+\)$") -and ($_ -match "^\*?\s*(?<ref>.*)")) { $matches['ref'] } }) +
$branches = @(git branch --no-color | ForEach-Object { if (($_ -notmatch "^\* \(HEAD detached .+\)$") -and ($_ -match "^[\*\+]?\s*(?<ref>.*)")) { $matches['ref'] } }) +
@(git branch --no-color -r | ForEach-Object { if ($_ -match "^ (?<ref>\S+)(?: -> .+)?") { $matches['ref'] } }) +
@(if ($includeHEAD) { 'HEAD','FETCH_HEAD','ORIG_HEAD','MERGE_HEAD' })

Expand Down

0 comments on commit c7f084e

Please sign in to comment.