From 17e3f7dc4776cf2734d2ffd1705db4e673ee60bc Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Thu, 23 Apr 2020 04:36:31 -0500 Subject: [PATCH] If the branch already exists, don't create it again. --- templates/merger.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/merger.xml b/templates/merger.xml index ea0dfe7..d679fd0 100644 --- a/templates/merger.xml +++ b/templates/merger.xml @@ -56,10 +56,10 @@ cd {{ NAME }} git checkout {{ DEFAULT_BRANCH }} -git checkout -b {{ PACKAGING_BRANCH_S }} || git checkout {{ PACKAGING_BRANCH_S }} +git branch -a | egrep "remotes/origin/{{ PACKAGING_BRANCH_S }}" && git checkout {{ PACKAGING_BRANCH_S }} || git checkout -b {{ PACKAGING_BRANCH_S }} git merge --ff-only {{ DEFAULT_BRANCH }} git push --set-upstream origin {{ PACKAGING_BRANCH_S }} -git checkout -b {{ PACKAGING_BRANCH_U }} || git checkout {{ PACKAGING_BRANCH_U }} +git branch -a | egrep "remotes/origin/{{ PACKAGING_BRANCH_U }}" && git checkout {{ PACKAGING_BRANCH_U }} || git checkout -b {{ PACKAGING_BRANCH_U }} git merge --ff-only {{ PACKAGING_BRANCH_S }} git push --set-upstream origin {{ PACKAGING_BRANCH_U }}