From f11bb607c55a71385fc795b10d9f583b46f2b960 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Wed, 25 Apr 2018 19:20:51 -0500 Subject: [PATCH] [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. --- modules/git/functions/git-branch-delete-interactive | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/git/functions/git-branch-delete-interactive b/modules/git/functions/git-branch-delete-interactive index a54bf90..5886cfe 100644 --- a/modules/git/functions/git-branch-delete-interactive +++ b/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[@]} )) && \