From 0c590aba74f28e94f03eb918c07a90cf1a51f525 Mon Sep 17 00:00:00 2001 From: wl2776 Date: Fri, 27 Aug 2021 19:07:19 +0300 Subject: [PATCH] fix(git): fix `gbda` alias when there are no merged branches (#10005) --- plugins/git/README.md | 2 +- plugins/git/git.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index 522257d2d..48cf87204 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -23,7 +23,7 @@ plugins=(... git) | gb | git branch | | gba | git branch -a | | gbd | git branch -d | -| gbda | git branch --no-color --merged \| command grep -vE "^(\+\|\*\|\s*($(git_main_branch)\|$(git_develop_branch))\s*$)" \| command xargs -n 1 git branch -d | +| gbda | git branch --no-color --merged \| grep -vE "^([+*]\|\s*($(git_main_branch)\|$(git_develop_branch))\s*$)" \| xargs git branch -d 2>/dev/null | | gbD | git branch -D | | gbl | git blame -b -w | | gbnm | git branch --no-merged | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 3cd558692..f0d9aaedc 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -73,7 +73,7 @@ alias gapt='git apply --3way' alias gb='git branch' alias gba='git branch -a' alias gbd='git branch -d' -alias gbda='git branch --no-color --merged | command grep -vE "^(\+|\*|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs -n 1 git branch -d' +alias gbda='git branch --no-color --merged | command grep -vE "^([+*]|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs git branch -d 2>/dev/null' alias gbD='git branch -D' alias gbl='git blame -b -w' alias gbnm='git branch --no-merged'