only remove real PR branches

This commit is contained in:
2014-12-23 15:41:02 -07:00
parent 4ba4906c2a
commit 2ae6d06e82

View File

@@ -57,6 +57,10 @@ get_pr() {
del_pr() { del_pr() {
BRANCH=`git rev-parse --abbrev-ref HEAD` 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} git checkout - && git branch -D ${BRANCH}
} }