Skip to content

Commit

Permalink
fix: condition
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosAndreo committed Feb 20, 2025
1 parent cd7468a commit a3ed3f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions phases/utils/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ def git_switch(path: str, branch: str = None, tag: str = None, commit: str = Non
"""
repo = get_repo(path)
msg("info", f"Switching to branch {branch}")
if tag or commit:
repo.git.switch("--detach", branch)
if tag:
repo.git.switch("--detach", tag)
elif commit:
repo.git.switch("--detach", commit)
else:
repo.git.switch(branch)
msg("info", "Switched to branch")
Expand Down

0 comments on commit a3ed3f6

Please sign in to comment.