From 4825d1d3695e37ee2000c8f35a02e5c9c04bd5de Mon Sep 17 00:00:00 2001 From: Jedrzej Kosinski Date: Tue, 9 Jun 2026 21:45:15 -0700 Subject: [PATCH] fix(git_compat): stop rewriting repo remotes on disk under pygit2 backend Removing _normalize_remote_urls(): persistently rewriting a repo's SSH origin to HTTPS mutates on-disk repo state, which is risky if interrupted. The pygit2 backend already neutralizes auth-forcing global config (insteadOf, credential helpers) by blanking libgit2's config search path, so anonymous HTTPS fetch works without touching the stored remote. Manager already prefers the GitPython/system-git backend when a system git is present (which honors the user's full git config including insteadOf https->ssh and proxies), and only uses the bundled pygit2 when system git is absent or CM_USE_PYGIT2=1 is set. Amp-Thread-ID: https://ampcode.com/threads/T-019eafa0-16a1-726e-91a4-dac1a40d4481 Co-authored-by: Amp --- comfyui_manager/common/git_compat.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/comfyui_manager/common/git_compat.py b/comfyui_manager/common/git_compat.py index f2d396ca..61991bf3 100644 --- a/comfyui_manager/common/git_compat.py +++ b/comfyui_manager/common/git_compat.py @@ -446,18 +446,6 @@ class _Pygit2Repo(GitRepo): pass self._repo = _pygit2.Repository(git_dir) self._working_dir = repo_path - self._normalize_remote_urls() - - def _normalize_remote_urls(self): - """Rewrite any SSH-form remote URLs to anonymous HTTPS so fetch/pull - never require SSH credentials under the pygit2 backend.""" - for remote in self._repo.remotes: - https_url = _to_https_url(remote.url) - if https_url != remote.url: - try: - self._repo.remotes.set_url(remote.name, https_url) - except Exception: - pass @property def working_dir(self):