diff --git a/__init__.py b/__init__.py index 110cae6..2155429 100644 --- a/__init__.py +++ b/__init__.py @@ -29,7 +29,7 @@ except: print(f"[WARN] ComfyUI-Manager: Your ComfyUI version is outdated. Please update to the latest version.") -version = [2, 8, 2] +version = [2, 8, 3] version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '') print(f"### Loading: ComfyUI-Manager ({version_str})") @@ -447,6 +447,9 @@ def git_repo_has_updates(path, do_fetch=False, do_update=False): # Fetch the latest commits from the remote repository repo = git.Repo(path) + current_branch = repo.active_branch + branch_name = current_branch.name + remote_name = 'origin' remote = repo.remote(name=remote_name) @@ -460,8 +463,6 @@ def git_repo_has_updates(path, do_fetch=False, do_update=False): if repo.head.is_detached: switch_to_default_branch(repo) - current_branch = repo.active_branch - branch_name = current_branch.name remote_commit_hash = repo.refs[f'{remote_name}/{branch_name}'].object.hexsha if commit_hash == remote_commit_hash: @@ -1685,7 +1686,7 @@ async def update_comfyui(request): current_branch = repo.active_branch branch_name = current_branch.name - remote_name = 'origin' + remote_name = current_branch.tracking_branch().remote_name remote = repo.remote(name=remote_name) try: diff --git a/git_helper.py b/git_helper.py index e6a85b3..dbe3271 100644 --- a/git_helper.py +++ b/git_helper.py @@ -52,7 +52,7 @@ def gitcheck(path, do_fetch=False): current_branch = repo.active_branch branch_name = current_branch.name - remote_name = 'origin' + remote_name = current_branch.tracking_branch().remote_name remote = repo.remote(name=remote_name) if do_fetch: @@ -104,7 +104,7 @@ def gitpull(path): current_branch = repo.active_branch branch_name = current_branch.name - remote_name = 'origin' + remote_name = current_branch.tracking_branch().remote_name remote = repo.remote(name=remote_name) remote.fetch()