mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-04 23:37:31 +00:00
[PR #2972] [MERGED] fix(git_compat): harden pygit2 fallback path; prefer system git when available #2918
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/ComfyUI-Manager#2918
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/ComfyUI-Manager/pull/2972
Author: @Kosinkadink
Created: 6/10/2026
Status: ✅ Merged
Merged: 6/10/2026
Merged by: @ltdrdata
Base:
manager-v4← Head:fix/pygit2-ignore-global-git-config📝 Commits (4)
498e896fix(git_compat): ignore global git config in pygit2 backend222ae16fix(git_compat): preserve corporate http.proxy in pygit2 backend4825d1dfix(git_compat): stop rewriting repo remotes on disk under pygit2 backend3119270fix(git_compat): fetch SSH-origin repos via in-memory anonymous HTTPS📊 Changes
1 file changed (+87 additions, -6 deletions)
View changed files
📝
comfyui_manager/common/git_compat.py(+87 -6)📄 Description
Summary
Hardens the pygit2 fallback path in
git_compat.py. Paired with Comfy-Org/Comfy-Desktop#1038, which is the actual fix for the Desktop update/migration failure (Comfy-Desktop#1036).Context
The bundled pygit2/libgit2 honors the user's global git config but ships HTTPS-only (no SSH transport). A global
insteadOfrewrite (https://github.com/?git@github.com:) makes pygit2 fetch/clone fail withauthentication required but no callback set.Manager's backend selection already does the right thing and is unchanged here:
Since Comfy-Desktop#1038 stops forcing
CM_USE_PYGIT2, Manager now prefers system git (GitPython) whenever it's present - which honors the user's full config (insteadOf, proxy, ssh keys, credential helpers) and sidesteps the bug entirely. There's no real reason to prefer pygit2 when system git exists, so we don't.What this PR changes (fallback path only)
pygit2 is now reached only as a no-system-git fallback (or when a developer sets
COMFY_FORCE_PYGIT2=1). To keep that path robust:search_pathblanking). Protects the no-git box that still has a stray~/.gitconfigwith aninsteadOfrewrite (e.g. from GitHub Desktop or synced dotfiles), which would otherwise reproduce the identical failure.http.proxy- snapshot it before blanking and pass it explicitly to clone/fetch, so config blanking doesn't strip a corporate proxy.All changes live inside the
if USE_PYGIT2:path, so they are inert whenever system git is available.Not destructive
Removed the earlier on-disk remote-URL rewrite (
_normalize_remote_urls): persistently rewriting a repo's storedoriginis risky if interrupted and unnecessary given the config blanking. Everything here is in-memory only.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.