summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorFrancesco Ilario <filario@redhat.com>2024-05-10 19:17:18 +0200
committerGitHub <noreply@github.com>2024-05-10 19:17:18 +0200
commit0fabd5f22f4e0378b09c92607789fdb17cab3c20 (patch)
treeb9af2983d4d9475acef6d115fc7167d8889d5e92 /plugins
parentd2cf10c29f2ebcbdbcc70ed3569aa3333d70d00d (diff)
downloadzsh-0fabd5f22f4e0378b09c92607789fdb17cab3c20.tar.gz
zsh-0fabd5f22f4e0378b09c92607789fdb17cab3c20.tar.bz2
zsh-0fabd5f22f4e0378b09c92607789fdb17cab3c20.zip
fix(git): add checked-out branch support to `gbg*` (#12397)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/git/README.md4
-rw-r--r--plugins/git/git.plugin.zsh4
2 files changed, 4 insertions, 4 deletions
diff --git a/plugins/git/README.md b/plugins/git/README.md
index 4c005ad2f..4022f8c62 100644
--- a/plugins/git/README.md
+++ b/plugins/git/README.md
@@ -41,8 +41,8 @@ plugins=(... git)
| `gba` | `git branch --all` |
| `gbd` | `git branch --delete` |
| `gbD` | `git branch --delete --force` |
-| `gbgd` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| awk '"'"'{print $1}'"'"' \| xargs git branch -d` |
-| `gbgD` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| awk '"'"'{print $1}'"'"' \| xargs git branch -D` |
+| `gbgd` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| cut -c 3- \| awk '"'"'{print $1}'"'"' \| xargs git branch -d` |
+| `gbgD` | `LANG=C git branch --no-color -vv \| grep ": gone\]" \| cut -c 3- \| awk '"'"'{print $1}'"'"' \| xargs git branch -D` |
| `gbm` | `git branch --move` |
| `gbnm` | `git branch --no-merged` |
| `gbr` | `git branch --remote` |
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
index 146f4a512..c48e365b5 100644
--- a/plugins/git/git.plugin.zsh
+++ b/plugins/git/git.plugin.zsh
@@ -147,8 +147,8 @@ function gbds() {
done
}
-alias gbgd='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -d'
-alias gbgD='LANG=C git branch --no-color -vv | grep ": gone\]" | awk '"'"'{print $1}'"'"' | xargs git branch -D'
+alias gbgd='LANG=C git branch --no-color -vv | grep ": gone\]" | cut -c 3- | awk '"'"'{print $1}'"'"' | xargs git branch -d'
+alias gbgD='LANG=C git branch --no-color -vv | grep ": gone\]" | cut -c 3- | awk '"'"'{print $1}'"'"' | xargs git branch -D'
alias gbm='git branch --move'
alias gbnm='git branch --no-merged'
alias gbr='git branch --remote'