fixed: switch_to_default_branch - robust patch

https://github.com/ltdrdata/ComfyUI-Manager/issues/1392#issuecomment-2569675066
This commit is contained in:
Dr.Lt.Data committed 2025-01-04 09:48:56 +09:00
1 parent 4dee009d51
commit faf1209eba
3 files changed
+24 -6

No files matched your search

+12 -3
View File
@@ -36,7 +36,7 @@ import manager_downloader
from node_package import InstalledNodePackage
version_code = [3, 3, 8]
version_code = [3, 3, 9]
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
@@ -1510,8 +1510,17 @@ def get_config():
def switch_to_default_branch(repo):
default_branch = repo.git.symbolic_ref('refs/remotes/origin/HEAD').replace('refs/remotes/origin/', '')
repo.git.checkout(default_branch)
try:
default_branch = repo.git.symbolic_ref('refs/remotes/origin/HEAD').replace('refs/remotes/origin/', '')
repo.git.checkout(default_branch)
except:
try:
repo.git.checkout(repo.heads.master)
except:
try:
repo.git.checkout(repo.heads.main)
except:
print("[ComfyUI Manager] Failed to switch to the default branch (master or main)")
def try_install_script(url, repo_path, install_cmd, instant_execution=False):
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.