fix(git_compat): follow-ups for pygit2 fallback hardening (#2974)
Python Linting / Run Ruff (push) Waiting to run
Publish to PyPI / build-and-publish (push) Has been cancelled

- Route list_remotes() fetch through _fetch_remote so the proxy and
  SSH-to-HTTPS rewrite apply to every fetch entry point, and provide
  pull on its proxies (parity with get_remote and the GitPython proxy)
  via a shared _pull_remote helper
- Rework _to_https_url: handle ssh://git@host:port/... URLs (drop the
  custom SSH port instead of mangling it into the path) and collapse
  leading slashes so git@host:/abs/path no longer yields a double-slash
  URL. Behavior narrowing: colon-less git@host/path (not a valid
  scp-form URL), ssh:// URLs with a port but no path, and IPv6 ssh://
  URLs are now returned unchanged instead of being wrongly converted
- clone_repo: omit the proxy= kwarg when no proxy is configured, so
  proxy-less installs keep working on pygit2 older than 1.18
- Simplify redundant except (KeyError, Exception) clause
- Require pygit2>=1.18 (clone_repository proxy= parameter)
- Add unit tests for _to_https_url (incl. negative cases pinning the
  narrowing) and a regression test that list_remotes proxies route
  fetch/pull through their own remote (late-binding guard)
This commit is contained in:
Dr.Lt.Data
2026-06-10 18:19:55 +09:00
committed by GitHub
parent 622a7077a5
commit 8b98723b42
4 changed files with 146 additions and 27 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ dependencies = [
]
[project.optional-dependencies]
dev = ["pre-commit", "pytest", "ruff", "pytest-cov", "pygit2"]
dev = ["pre-commit", "pytest", "ruff", "pytest-cov", "pygit2>=1.18"]
[project.urls]
Repository = "https://github.com/ltdrdata/ComfyUI-Manager"