From 3258116b43403d05539b4d238d2e67a88bd49643 Mon Sep 17 00:00:00 2001 From: Tcharp38 Date: Tue, 23 Apr 2024 15:00:56 +0200 Subject: [PATCH] create_branch enhancement --- .tools/create_branch.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.tools/create_branch.sh b/.tools/create_branch.sh index 5ac0cc7355..a0c4701c73 100755 --- a/.tools/create_branch.sh +++ b/.tools/create_branch.sh @@ -230,13 +230,15 @@ if [ "${TARG_BRANCH}" == "stable" ]; then fi fi -# Delete target branch & push new one -REM=`git branch -a | grep remotes/${TARG_REPO}/${TARG_BRANCH}` -if [ $? -eq 0 ]; then +# Delete target branch (origin/beta) & push new one +#REM=`git branch -a | grep remotes/${TARG_REPO}/${TARG_BRANCH}` +REM=`git ls-remote ${TARG_REPO} ${TARG_BRANCH}` +#if [ $? -eq 0 ]; then +if [ "${REM}" != "" ]; then echo "Deleting ${TARG_REPO}/${TARG_BRANCH} branch" git push -q ${TARG_REPO} --delete ${TARG_BRANCH} if [ $? -ne 0 ]; then - echo "= ERROR: git push --delete failed" + echo "= ERROR: git push ${TARG_REPO} --delete ${TARG_BRANCH} failed" exit 33 fi fi