aboutsummaryrefslogtreecommitdiffstats
path: root/modules/launch_utils.py
diff options
context:
space:
mode:
authorJabasukuriputo Wang <wfjsw@users.noreply.github.com>2023-08-01 03:26:59 +0000
committerGitHub <noreply@github.com>2023-08-01 03:26:59 +0000
commit8b036d8a8253996f2a9c977bea63babbe59eb348 (patch)
treefe319c879c2d50f669b25a9f484c63cfa7f5be45 /modules/launch_utils.py
parentc46525b70b54e4f6eaa8326d20777ecbad959a20 (diff)
downloadstable-diffusion-webui-gfx803-8b036d8a8253996f2a9c977bea63babbe59eb348.tar.gz
stable-diffusion-webui-gfx803-8b036d8a8253996f2a9c977bea63babbe59eb348.tar.bz2
stable-diffusion-webui-gfx803-8b036d8a8253996f2a9c977bea63babbe59eb348.zip
fix
Diffstat (limited to 'modules/launch_utils.py')
-rw-r--r--modules/launch_utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/launch_utils.py b/modules/launch_utils.py
index 4be25990..7225af08 100644
--- a/modules/launch_utils.py
+++ b/modules/launch_utils.py
@@ -139,7 +139,7 @@ def check_run_python(code: str) -> bool:
return result.returncode == 0
-def git_fix_workspace(dir):
+def git_fix_workspace(dir, name):
run(f'"{git}" -C "{dir}" fetch --refetch --no-auto-gc', f"Fetching all contents for {name}", f"Couldn't fetch {name}", live=True)
run(f'"{git}" -C "{dir}" gc --aggressive --prune=now', f"Pruning {name}", f"Couldn't prune {name}", live=True)
return
@@ -158,7 +158,7 @@ def git_clone(url, dir, name, commithash=None):
return
except Exception:
print(f"Unable to determine {name}'s hash, attempting autofix...")
- git_fix_workspace(dir)
+ git_fix_workspace(dir, name)
current_hash = subprocess.check_output([git, "-C", dir, "rev-parse", "HEAD"], shell=False, encoding='utf8').strip()
if current_hash == commithash:
return
@@ -169,7 +169,7 @@ def git_clone(url, dir, name, commithash=None):
run(f'"{git}" -C "{dir}" checkout {commithash}', f"Checking out commit for {name} with hash: {commithash}...", f"Couldn't checkout commit {commithash} for {name}", live=True)
except RuntimeError:
print(f"Unable to checkout {name} with hash {commithash}, attempting autofix...")
- git_fix_workspace(dir)
+ git_fix_workspace(dir, name)
run(f'"{git}" -C "{dir}" checkout {commithash}', f"Checking out commit for {name} with hash: {commithash}...", f"Couldn't checkout commit {commithash} for {name}", live=True)
return