Skip to content

Commit

Permalink
Handle case in the updater when master branch is not in local repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Jul 27, 2024
1 parent e746965 commit 07f6a1a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .ci/update_windows/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,15 @@ def pull(repo, remote_name='origin', branch='master'):

print("checking out master branch")
branch = repo.lookup_branch('master')
ref = repo.lookup_reference(branch.name)
repo.checkout(ref)
if branch is None:
ref = repo.lookup_reference('refs/remotes/origin/master')
repo.checkout(ref)
branch = repo.lookup_branch('master')
if branch is None:
repo.create_branch('master', repo.get(ref.target))
else:
ref = repo.lookup_reference(branch.name)
repo.checkout(ref)

print("pulling latest changes")
pull(repo)
Expand Down

0 comments on commit 07f6a1a

Please sign in to comment.