From 827dbbc740598aa4ee6be3b74f1dbba175b061f3 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 8 Jan 2021 10:28:23 -0500 Subject: [PATCH] fix: delete the deploy branch if its a ref and not tag --- plugins/git/internal-functions | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/git/internal-functions b/plugins/git/internal-functions index 3188270c7..26f551327 100755 --- a/plugins/git/internal-functions +++ b/plugins/git/internal-functions @@ -225,6 +225,9 @@ fn-git-clone() { DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")" if [[ "$GIT_REF" != "$DOKKU_DEPLOY_BRANCH" ]]; then + if [[ "$is_ref" == "true" ]]; then + git -C "$APP_CLONE_ROOT" branch -qq -D "$DOKKU_DEPLOY_BRANCH" 2>/dev/null || true + fi git -C "$APP_CLONE_ROOT" checkout -qq -b "$DOKKU_DEPLOY_BRANCH" fi