浏览代码

fix(git): fix check in `gbds` function

Marc Cornellà 1 年之前
父节点
当前提交
f79647dba5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      plugins/git/git.plugin.zsh

+ 1 - 1
plugins/git/git.plugin.zsh

@@ -141,7 +141,7 @@ function gbds() {
   git for-each-ref refs/heads/ "--format=%(refname:short)" | \
     while read branch; do
       local merge_base=$(git merge-base $default_branch $branch)
-      if [[ '-*' == $(git cherry $default_branch $(git commit-tree $(git rev-parse $branch\^{tree}) -p $merge_base -m _)) ]]; then
+      if [[ $(git cherry $default_branch $(git commit-tree $(git rev-parse $branch\^{tree}) -p $merge_base -m _)) = -* ]]; then
         git branch -D $branch
       fi
     done