mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-18 02:43:00 +08:00
Fix for adding ComfyUI path to Git safe.directory
Git wants a path that looks like this: D:/ComfyUI
This commit is contained in:
parent
6ffb10becb
commit
7e4b5c4f3f
14
__init__.py
14
__init__.py
@ -317,8 +317,9 @@ def __win_check_git_update(path, do_fetch=False, do_update=False):
|
|||||||
if 'detected dubious' in output:
|
if 'detected dubious' in output:
|
||||||
try:
|
try:
|
||||||
# fix and try again
|
# fix and try again
|
||||||
print(f"[ComfyUI-Manager] Try fixing 'dubious repository' error on '{path}' repo")
|
safedir_path = path.replace('\\', '/')
|
||||||
process = subprocess.Popen(['git', 'config', '--global', '--add', 'safe.directory', path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
print(f"[ComfyUI-Manager] Try fixing 'dubious repository' error on '{safedir_path}' repo")
|
||||||
|
process = subprocess.Popen(['git', 'config', '--global', '--add', 'safe.directory', safedir_path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
output, _ = process.communicate()
|
output, _ = process.communicate()
|
||||||
|
|
||||||
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
@ -330,7 +331,7 @@ def __win_check_git_update(path, do_fetch=False, do_update=False):
|
|||||||
if 'detected dubious' in output:
|
if 'detected dubious' in output:
|
||||||
print(f'\n[ComfyUI-Manager] Failed to fixing repository setup. Please execute this command on cmd: \n'
|
print(f'\n[ComfyUI-Manager] Failed to fixing repository setup. Please execute this command on cmd: \n'
|
||||||
f'-----------------------------------------------------------------------------------------\n'
|
f'-----------------------------------------------------------------------------------------\n'
|
||||||
f'git config --global --add safe.directory "{path}"\n'
|
f'git config --global --add safe.directory "{safedir_path}"\n'
|
||||||
f'-----------------------------------------------------------------------------------------\n')
|
f'-----------------------------------------------------------------------------------------\n')
|
||||||
|
|
||||||
if do_update:
|
if do_update:
|
||||||
@ -1516,16 +1517,17 @@ async def update_comfyui(request):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
remote.fetch()
|
remote.fetch()
|
||||||
except Exception as e:
|
except Exception as str(e):
|
||||||
if 'detected dubious' in e:
|
if 'detected dubious' in e:
|
||||||
print(f"[ComfyUI-Manager] Try fixing 'dubious repository' error on 'ComfyUI' repository")
|
print(f"[ComfyUI-Manager] Try fixing 'dubious repository' error on 'ComfyUI' repository")
|
||||||
subprocess.run(['git', 'config', '--global', '--add', 'safe.directory', comfy_path])
|
safedir_path = comfy_path.replace('\\', '/')
|
||||||
|
subprocess.run(['git', 'config', '--global', '--add', 'safe.directory', safedir_path])
|
||||||
try:
|
try:
|
||||||
remote.fetch()
|
remote.fetch()
|
||||||
except Exception:
|
except Exception:
|
||||||
print(f"\n[ComfyUI-Manager] Failed to fixing repository setup. Please execute this command on cmd: \n"
|
print(f"\n[ComfyUI-Manager] Failed to fixing repository setup. Please execute this command on cmd: \n"
|
||||||
f"-----------------------------------------------------------------------------------------\n"
|
f"-----------------------------------------------------------------------------------------\n"
|
||||||
f'git config --global --add safe.directory "{comfy_path}"\n'
|
f'git config --global --add safe.directory "{safedir_path}"\n'
|
||||||
f"-----------------------------------------------------------------------------------------\n")
|
f"-----------------------------------------------------------------------------------------\n")
|
||||||
|
|
||||||
commit_hash = repo.head.commit.hexsha
|
commit_hash = repo.head.commit.hexsha
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user