@@ -136,8 +136,8 @@ function script:gitBranches($filter, $includeHEAD = $false, $prefix = '') {
136
136
$filter = $matches [' to' ]
137
137
}
138
138
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' ] } }) +
141
141
@ (if ($includeHEAD ) { ' HEAD' , ' FETCH_HEAD' , ' ORIG_HEAD' , ' MERGE_HEAD' })
142
142
143
143
$branches |
@@ -147,7 +147,7 @@ function script:gitBranches($filter, $includeHEAD = $false, $prefix = '') {
147
147
}
148
148
149
149
function script :gitRemoteUniqueBranches ($filter ) {
150
- git branch -- no- color - r |
150
+ git branch -- no- color -- remotes -- list " $filter * " |
151
151
ForEach-Object { if ($_ -match " ^ (?<remote>[^/]+)/(?<branch>\S+)(?! -> .+)?$" ) { $matches [' branch' ] } } |
152
152
Group-Object - NoElement |
153
153
Where-Object { $_.Count -eq 1 } |
@@ -169,23 +169,23 @@ function script:gitConfigKeys($section, $filter, $defaultOptions = '') {
169
169
}
170
170
171
171
function script :gitTags ($filter , $prefix = ' ' ) {
172
- git tag |
172
+ git tag -- list " $filter * " |
173
173
Where-Object { $_ -like " $filter *" } |
174
174
ForEach-Object { $prefix + $_ } |
175
175
quoteStringWithSpecialChars
176
176
}
177
177
178
178
function script :gitFeatures ($filter , $command ) {
179
179
$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' ] } })
181
181
$branches |
182
182
Where-Object { $_ -ne ' (no branch)' -and $_ -like " $filter *" } |
183
183
ForEach-Object { $featurePrefix + $_ } |
184
184
quoteStringWithSpecialChars
185
185
}
186
186
187
187
function script :gitRemoteBranches ($remote , $ref , $filter , $prefix = ' ' ) {
188
- git branch -- no- color - r |
188
+ git branch -- no- color -- remotes -- list " $remote / $filter * " |
189
189
Where-Object { $_ -like " $remote /$filter *" } |
190
190
ForEach-Object { $prefix + $ref + ($_ -replace " $remote /" , " " ) } |
191
191
quoteStringWithSpecialChars
0 commit comments