From f37f5b0ae2875f5ed8848f960c01e7cda43c608c Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Mon, 13 Jan 2025 06:37:47 +0900 Subject: [PATCH] fixed: snapshot - robust resolving the remote url --- glob/manager_core.py | 17 +++++++++++++++-- pyproject.toml | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/glob/manager_core.py b/glob/manager_core.py index e096289a..42d0db43 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -41,7 +41,7 @@ from node_package import InstalledNodePackage -version_code = [3, 7, 1] +version_code = [3, 7, 2] version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') @@ -2463,8 +2463,21 @@ async def get_current_snapshot(): cnr_custom_nodes[info['id']] = info['ver'] else: repo = git.Repo(fullpath) + + if repo.head.is_detached: + remote_name = get_remote_name(repo) + else: + current_branch = repo.active_branch + + if current_branch.tracking_branch() is None: + remote_name = get_remote_name(repo) + else: + remote_name = current_branch.tracking_branch().remote_name + commit_hash = repo.head.commit.hexsha - url = repo.remotes.origin.url + + url = repo.remotes[remote_name].url + git_custom_nodes[url] = dict(hash=commit_hash, disabled=is_disabled) except: print(f"Failed to extract snapshots for the custom node '{path}'.") diff --git a/pyproject.toml b/pyproject.toml index 8ec54d5f..554f771f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-manager" description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI." -version = "3.7.1" +version = "3.7.2" license = { file = "LICENSE.txt" } dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]