Просмотр исходного кода

[git] Update git-branch-delete-interactive

so we don't suggest deleting remote branches when `git rev-parse`
failed. For example, it could fail if a remote tracking branch is gone.
Eric Nielsen 6 лет назад
Родитель
Сommit
f11bb607c5
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      modules/git/functions/git-branch-delete-interactive

+ 1 - 1
modules/git/functions/git-branch-delete-interactive

@@ -3,7 +3,7 @@ local -a remotes
 if (( ${*[(I)(-r|--remotes)]} )); then
   remotes=(${^*:#-*})
 else
-  remotes=(${(f)"$(command git rev-parse --abbrev-ref ${^*:#-*}@{u} 2>/dev/null)"})
+  remotes=(${(f)"$(command git rev-parse --abbrev-ref ${^*:#-*}@{u} 2>/dev/null)"}) || remotes=()
 fi
 if command git branch --delete ${@} && \
     (( ${#remotes[@]} )) && \