chore: delete local feature branch before checking it out
This commit is contained in:
@@ -38,6 +38,14 @@ def git_push_changes(
|
||||
logger.info(f"Git Operation Failed: {e}")
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
def switch_branch(repo: git.Repo, branch_name: str):
|
||||
"""
|
||||
Create branch if it doesn't exist, then checkout
|
||||
|
||||
Reference in New Issue
Block a user