make-snapshot.sh: Only remove branch if it exists

This commit is contained in:
Johannes Meyer 2021-07-20 09:54:01 +02:00
parent 56aaf91bd4
commit 7ccdde5601
1 changed files with 4 additions and 1 deletions

View File

@ -14,7 +14,10 @@ LATEST_TAG=$(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname)'
TAGGED_BRANCH="stable/${LATEST_TAG:1}"
NEXT_VERSION=$(echo "${LATEST_TAG:1}" | awk -F. -v OFS=. '{$3=0}; {++$2}; {print}')
git branch -D $BRANCH
if [[ -n $(git branch | grep $BRANCH) ]]; then
git branch -D $BRANCH
fi
git checkout -b $BRANCH
git merge --no-ff -m "Merge latest stable, to make the latest tag reachable" $TAGGED_BRANCH