cli: only delete local branch if it exists
This commit is contained in:
+3
-2
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user