Repository navigation
Conversation
added 2 commits
November 11, 2026 16:20
… keys, and detect Windows RAM
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an unrecoverable repository clone state on Windows when an incremental
git fetchfails in a persistent clone directory (keep_shallow=True) and falls back to a freshgit clone:.git/objects/pack/*Cleanup on Windows (cleanup_repo_dir):cleanup_repo_dircalledshutil.rmtree(repo_dir, ignore_errors=True). On Windows, Git marks packfiles (.pack/.idx) inside.git\objects\packas read-only, causingshutil.rmtreeto fail withPermissionErrorand silently leave the non-empty directory behind due toignore_errors=True.git clonethen failed permanently withfatal: destination path '...' already exists and is not an empty directory.cleanup_repo_dirnow uses anonerror=_handle_remove_readonlycallback that clears read-only file attributes (os.chmod(path, stat.S_IWRITE | stat.S_IREAD)) and retries deletion, plus an atomic rename fallback (os.replace) if a handle is briefly held.shallow_clone_repo):originremote URL (git remote set-url origin) before runninggit fetchso token/credential updates take effect on existing clones.git reset --hardreturn code (falling back toFETCH_HEADor a fresh clone if reset fails).repo_diris cleaned up before the fallbackgit cloneand if the initial--branchclone fails.