@@ -136,8 +136,8 @@ function script:gitBranches($filter, $includeHEAD = $false, $prefix = '') {
136136 $filter = $matches [' to' ]
137137 }
138138
139- $branches = @ (git branch -- no- color | ForEach-Object { if (($_ -notmatch " ^\* \(HEAD detached .+\)$" ) -and ($_ -match " ^[\*\+]?\s*(?<ref>\S+)(?: -> .+)? " )) { $matches [' ref' ] } }) +
140- @ (git branch -- no- color - r | ForEach-Object { if ($_ -match " ^ (?<ref>\S+)(?: -> .+)?" ) { $matches [' ref' ] } }) +
139+ $branches = @ (git branch -- no- color -- list " $filter * " | ForEach-Object { if (($_ -notmatch " ^\* \(HEAD detached .+\)$" ) -and ($_ -match " ^[\*\+]?\s*(?<ref>.*) " )) { $matches [' ref' ] } }) +
140+ @ (git branch -- no- color -- remotes -- list " $filter * " | ForEach-Object { if ($_ -match " ^ (?<ref>\S+)(?: -> .+)?" ) { $matches [' ref' ] } }) +
141141 @ (if ($includeHEAD ) { ' HEAD' , ' FETCH_HEAD' , ' ORIG_HEAD' , ' MERGE_HEAD' })
142142
143143 $branches |
@@ -147,7 +147,7 @@ function script:gitBranches($filter, $includeHEAD = $false, $prefix = '') {
147147}
148148
149149function script :gitRemoteUniqueBranches ($filter ) {
150- git branch -- no- color - r |
150+ git branch -- no- color -- remotes -- list " $filter * " |
151151 ForEach-Object { if ($_ -match " ^ (?<remote>[^/]+)/(?<branch>\S+)(?! -> .+)?$" ) { $matches [' branch' ] } } |
152152 Group-Object - NoElement |
153153 Where-Object { $_.Count -eq 1 } |
@@ -169,23 +169,23 @@ function script:gitConfigKeys($section, $filter, $defaultOptions = '') {
169169}
170170
171171function script :gitTags ($filter , $prefix = ' ' ) {
172- git tag |
172+ git tag -- list " $filter * " |
173173 Where-Object { $_ -like " $filter *" } |
174174 ForEach-Object { $prefix + $_ } |
175175 quoteStringWithSpecialChars
176176}
177177
178178function script :gitFeatures ($filter , $command ) {
179179 $featurePrefix = git config -- local -- get " gitflow.prefix.$command "
180- $branches = @ (git branch -- no- color | ForEach-Object { if ($_ -match " ^\*?\s*$featurePrefix (?<ref>.*)" ) { $matches [' ref' ] } })
180+ $branches = @ (git branch -- no- color -- list " $filter * " | ForEach-Object { if ($_ -match " ^\*?\s*$featurePrefix (?<ref>.*)" ) { $matches [' ref' ] } })
181181 $branches |
182182 Where-Object { $_ -ne ' (no branch)' -and $_ -like " $filter *" } |
183183 ForEach-Object { $featurePrefix + $_ } |
184184 quoteStringWithSpecialChars
185185}
186186
187187function script :gitRemoteBranches ($remote , $ref , $filter , $prefix = ' ' ) {
188- git branch -- no- color - r |
188+ git branch -- no- color -- remotes -- list " $remote / $filter * " |
189189 Where-Object { $_ -like " $remote /$filter *" } |
190190 ForEach-Object { $prefix + $ref + ($_ -replace " $remote /" , " " ) } |
191191 quoteStringWithSpecialChars
0 commit comments