Skip to content

Commit 3cad6e3

Browse files
committed
🐛 Prevent error when branch is null in gbda
1 parent 8fcfa9f commit 3cad6e3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/aliases.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ function gba {
3434
function gbda {
3535
$MergedBranchs = $(git branch --merged | Select-String "^(\*|\s*(master|develop|dev)\s*$)" -NotMatch).Line
3636
$MergedBranchs | ForEach-Object {
37+
if ([string]::IsNullOrEmpty($_)) {
38+
return
39+
}
3740
git branch -d $_.Trim()
3841
}
3942
}

0 commit comments

Comments
 (0)