Skip to content

Commit

Permalink
Merge pull request #8269 from madhavajay/madhava/hagrid_fix_git
Browse files Browse the repository at this point in the history
Added repo.remotes.origin.fetch() to hagrid before calling checkout
  • Loading branch information
madhavajay authored Nov 16, 2023
2 parents 2bd6e09 + e4ee30c commit 4b42d4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/hagrid/hagrid/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def update_repo(repo: git.Repo, branch: str) -> None:
try:
if repo.is_dirty():
repo.git.reset("--hard")
repo.remotes.origin.fetch()
repo.git.checkout(branch)
repo.remotes.origin.pull()
console.print(f"{OK_EMOJI} Updated HAGrid from branch: {branch}")
Expand All @@ -241,6 +242,7 @@ def use_branch(branch: str) -> None:
try:
if repo.is_dirty():
repo.git.reset("--hard")
repo.remotes.origin.fetch()
repo.git.checkout(branch)
repo.remotes.origin.pull()
except Exception as e:
Expand Down

0 comments on commit 4b42d4f

Please sign in to comment.