df9cf723963e38d152b750d85f0907b57dde53bb

Author
Ryan Styrczula <rmstyrczula@users.noreply.github.com>
Committer
Ryan Styrczula <rmstyrczula@users.noreply.github.com>
Date

Message

plugins/git: Fix `gbda` trying to delete worktree branches

Git learned to add a `+` in front of branches that are
checked out in other worktrees.

See: https://github.com/git/git/blob/745f6812895b31c02b29bdfe4ae8e5498f776c26/Documentation/RelNotes/2.23.0.txt#L252-L256

Diff

 1diff --git a/plugins/git/README.md b/plugins/git/README.md
 2index 3311ccf552356a599a4ef8d16ca0d1667cab5ee7..7878f747b998445c5c8adb4a512a1c047227a059 100644
 3--- a/plugins/git/README.md
 4+++ b/plugins/git/README.md
 5@@ -22,7 +22,7 @@ plugins=(... git)
 6 | gb                   | git branch                                                                                                                    |
 7 | gba                  | git branch -a                                                                                                                 |
 8 | gbd                  | git branch -d                                                                                                                 |
 9-| gbda                 | git branch --no-color --merged \| command grep -vE "^(\*\|\s*(master\|develop\|dev)\s*$)" \| command xargs -n 1 git branch -d |
10+| gbda                 | git branch --no-color --merged \| command grep -vE "^(\+|\*\|\s*(master\|develop\|dev)\s*$)" \| command xargs -n 1 git branch -d |
11 | gbD                  | git branch -D                                                                                                                 |
12 | gbl                  | git blame -b -w                                                                                                               |
13 | gbnm                 | git branch --no-merged                                                                                                        |
14diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
15index 9787392de44f9d533a70f9d6ac04dcbc12c49165..2edee02982333f81134a8ed0e39a6cc5239c4afd 100644
16--- a/plugins/git/git.plugin.zsh
17+++ b/plugins/git/git.plugin.zsh
18@@ -42,7 +42,7 @@ alias gap='git apply'
19 alias gb='git branch'
20 alias gba='git branch -a'
21 alias gbd='git branch -d'
22-alias gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
23+alias gbda='git branch --no-color --merged | command grep -vE "^(\+|\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
24 alias gbD='git branch -D'
25 alias gbl='git blame -b -w'
26 alias gbnm='git branch --no-merged'