You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: validate default branch exists before setting HEAD in List method
The List method was blindly setting HEAD to point to the configured default
branch without verifying the branch actually exists. This caused "couldn't
find remote ref" errors when cloning repositories with misconfigured default
branches (e.g., pointing to non-existent "master" branch).
Changes:
- Add validation to check if configured default branch exists
- Implement fallback logic: prefer "main" branch, then first available branch
- Add warning logs when falling back to different branch
- Handle edge case of repositories with no branches
- Prevent fatal clone errors due to invalid HEAD references
Fixes scenarios where repository default branch configuration points to
non-existent branches, improving clone reliability and user experience.
0 commit comments