From 7d9ac4ba153e2a20f43a56ca244534f91b8d1cb0 Mon Sep 17 00:00:00 2001 From: "dr.lt.data" Date: Thu, 14 Dec 2023 11:25:33 +0900 Subject: [PATCH] fix: try fixing'dubious repository' for ComfyUI --- __init__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/__init__.py b/__init__.py index 14ec5884..c3918e42 100644 --- a/__init__.py +++ b/__init__.py @@ -20,7 +20,7 @@ import nodes import torch -version = [1, 13, 3] +version = [1, 13, 4] version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '') print(f"### Loading: ComfyUI-Manager ({version_str})") @@ -306,7 +306,7 @@ def __win_check_git_update(path, do_fetch=False, do_update=False): if 'detected dubious' in output: try: # fix and try again - print(f"[ComfyUI-Manager] Try fixing 'Dubious' error on '{path}'") + print(f"[ComfyUI-Manager] Try fixing 'dubious repository' error on '{path}' repo") process = subprocess.Popen(['git', 'config', '--global', '--add', 'safe.directory', path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) output, _ = process.communicate() output = output.decode('utf-8').strip() @@ -1472,7 +1472,14 @@ async def update_comfyui(request): remote_name = 'origin' remote = repo.remote(name=remote_name) - remote.fetch() + + try: + remote.fetch() + except Exception as e: + if 'detected dubious' in e: + print(f"[ComfyUI-Manager] Try fixing 'dubious repository' error on 'ComfyUI' repository") + subprocess.run(['git', 'config', '--global', '--add', 'safe.directory', comfy_path]) + remote.fetch() commit_hash = repo.head.commit.hexsha remote_commit_hash = repo.refs[f'{remote_name}/{branch_name}'].object.hexsha