mirror of
https://git.datalinker.icu/ltdrdata/ComfyUI-Manager
synced 2025-12-24 05:24:25 +08:00
Merge pull request #280 from mortael/patch-1
Fix for adding ComfyUI path to Git safe.directory
This commit is contained in:
commit
9557a24409
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:
|
||||||
@ -1517,15 +1518,16 @@ async def update_comfyui(request):
|
|||||||
try:
|
try:
|
||||||
remote.fetch()
|
remote.fetch()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if 'detected dubious' in e:
|
if 'detected dubious' in str(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…
x
Reference in New Issue
Block a user