Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/remove local wl branch #44

Merged
merged 5 commits into from
Feb 2, 2024
Merged

Conversation

all4code
Copy link
Collaborator

Description of the Change

Cleanup workload init / remove local feature branches to allow re-use of workload names.

@all4code all4code requested a review from mturetskii January 30, 2024 11:27
mturetskii
mturetskii previously approved these changes Jan 30, 2024
@@ -51,6 +51,12 @@ def upload_changes(self):
def switch_to_branch(self, branch_name: str = "main"):
self._repo.heads[branch_name].checkout()

@trace()
def delete_branch(self, branch_name: str):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do it something like this?

@trace()
 def delete_branch(self, branch_name: str):
        try:
            ref = self._repo.heads[branch_name]
        except KeyError:
            logger.warning(f"Branch '{branch_name}' does not exist.")
            return
        self._repo.delete_head(ref, force=True)
        logger.debug(f"Branch '{branch_name}' successfully deleted.")

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, I will introduce the change suggested here.

@all4code all4code requested a review from mturetskii February 1, 2024 16:50
@all4code all4code merged commit ac4d737 into main Feb 2, 2024
@all4code all4code deleted the feature/remove-local-wl-branch branch February 2, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants