Handle case in the updater when master branch is not in local repo.

This commit is contained in:
comfyanonymous 2024-07-27 03:15:22 -04:00
parent e746965c50
commit 07f6a1a685
1 changed files with 9 additions and 2 deletions

View File

@ -62,8 +62,15 @@ except:
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)