Skip to content

Commit

Permalink
Attempt to pull new tags if fetching a tag fails
Browse files Browse the repository at this point in the history
  • Loading branch information
eliminmax authored and trufae committed May 7, 2024
1 parent ab6cce7 commit 5578bee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion r2env/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ def git_fetch(url, version, source_path):
f"Verify the source path is not dirty. Error: {err}") \
from err
if version != "git":
repo.git.checkout(version)
try:
repo.git.checkout(version)
except git.GitCommandError:
# try again after pulling new tags from origin
repo.git.fetch("origin", "--tags")
repo.git.checkout(version)
sms = repo.submodules
for sm in sms:
if not sm.module_exists():
Expand Down

0 comments on commit 5578bee

Please sign in to comment.