cli: only delete local branch if it exists
Deploy bin / deploy (push) Successful in 1s
Deploy, build and restart MASTER / deploy (push) Successful in 2s
Deploy agebd python package / deploy (push) Successful in 2s

This commit is contained in:
Benjamin Labrecque
2026-07-07 11:14:52 +02:00
parent c96600cd85
commit 27a7a8a54d
+3 -2
View File
@@ -44,8 +44,9 @@ def delete_local_branch(repo: git.Repo, branch_name: str):
"""
Delete local branch if it already exists
"""
logger.info(f"Deleting local branch '{branch_name}'...")
repo.git.branch("-D", branch_name)
if branch_name in repo.branches:
logger.info(f"Deleting local branch '{branch_name}'...")
repo.git.branch("-D", branch_name)
def switch_branch(repo: git.Repo, branch_name: str):