From 2ae6d06e8250ed062d60af6f181dd04abba84340 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Tue, 23 Dec 2014 15:41:02 -0700 Subject: [PATCH] only remove real PR branches --- git/githelpers | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git/githelpers b/git/githelpers index 39af463..4edb54f 100644 --- a/git/githelpers +++ b/git/githelpers @@ -57,6 +57,10 @@ get_pr() { del_pr() { BRANCH=`git rev-parse --abbrev-ref HEAD` + if [[ ! ${BRANCH} =~ ^pr\/ ]]; then + echo "Not a PR branch, aborting!" + exit 1 + fi git checkout - && git branch -D ${BRANCH} }