mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 00:13:36 +01:00
Improved list-branches.ps1
This commit is contained in:
parent
d6f3df71b3
commit
77639425d2
@ -18,12 +18,14 @@ try {
|
||||
try {
|
||||
set-location $RepoDir
|
||||
|
||||
$Branches = $(git branch --list "$Pattern" --remotes --no-color --no-column)
|
||||
$Branches = $(git branch --list --remotes --no-color --no-column)
|
||||
if ($lastExitCode -ne "0") { throw "'git branch --list' failed" }
|
||||
|
||||
foreach($Branch in $Branches) {
|
||||
if ("$Branch" -match "origin/HEAD") { continue }
|
||||
write-output "$($Branch.substring(9))"
|
||||
$BranchName = $Branch.substring(9)
|
||||
if ("$BranchName" -notlike "$Pattern") { continue }
|
||||
write-output "$BranchName"
|
||||
}
|
||||
exit 0
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user