diff options
author | brkirch <brkirch@users.noreply.github.com> | 2023-07-20 05:44:45 +0000 |
---|---|---|
committer | brkirch <brkirch@users.noreply.github.com> | 2023-08-13 14:07:52 +0000 |
commit | f4dbb0c820344798e3481d4104618b95594a3d10 (patch) | |
tree | 4ebb384cde86e36a7501805807ea24cecd40f0e2 | |
parent | 9058620cec2788495d295f4e68ef2932d6d700e6 (diff) | |
download | stable-diffusion-webui-gfx803-f4dbb0c820344798e3481d4104618b95594a3d10.tar.gz stable-diffusion-webui-gfx803-f4dbb0c820344798e3481d4104618b95594a3d10.tar.bz2 stable-diffusion-webui-gfx803-f4dbb0c820344798e3481d4104618b95594a3d10.zip |
Change the repositories origin URLs when necessary
-rw-r--r-- | modules/launch_utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/launch_utils.py b/modules/launch_utils.py index e77baa52..9eda7c9d 100644 --- a/modules/launch_utils.py +++ b/modules/launch_utils.py @@ -173,6 +173,9 @@ def git_clone(url, dir, name, commithash=None): if current_hash == commithash:
return
+ if run_git(dir, name, 'config --get remote.origin.url', None, f"Couldn't determine {name}'s origin URL", live=False).strip() != url:
+ run_git(dir, name, f'remote set-url origin "{url}"', None, f"Failed to set {name}'s origin URL", live=False)
+
run_git(dir, name, 'fetch', f"Fetching updates for {name}...", f"Couldn't fetch {name}", autofix=False)
run_git(dir, name, f'checkout {commithash}', f"Checking out commit for {name} with hash: {commithash}...", f"Couldn't checkout commit {commithash} for {name}", live=True)
|