4547105f3b
- Create normal working clones for remote repositories - Initialize blank repositories with a main branch - Align pull and branch helpers with unborn HEAD handling - Gate fetch/pull on repositories with a remote Quality gates: vitest repositories-settings-tab (passed); api pytest blocked by missing fastapi in environment
1.4 KiB
1.4 KiB
Context
Repository creation currently produces mirrored bare repos for any remote clone and bare repos for blank creations. The workspace, file browser, commit editor, and git toolbar are built around a working-tree repository model, so users can hit 400s when they try to sync or when the repo has no usable branch state.
Goals
- Create working clones for remote repositories
- Create working repos with an initial branch for blank repositories
- Preserve the existing repository create endpoint and shared UI flow
- Keep fetch/pull/push aligned with a normal local clone
Decisions
- Clone mode
- Use
git clonewithout--mirror - Keep the existing remote URL preflight and URL parsing behavior
- Blank repositories
- Initialize with
git init -b mainwhen supported - Fall back to
git initplusgit symbolic-ref HEAD refs/heads/mainif needed
- Branch state
- Treat
mainas the initial branch name for blank repos - Make branch listing and current-branch helpers tolerate unborn
HEAD
- Pull behavior
- Prefer the current branch when no explicit branch is supplied
- Do not force
origin <branch>if the branch is unborn or already tracked by the current checkout
Risks
- Some older git versions may not support
git init -b; the backend should fall back cleanly - Existing blank repos created under the old bare model may still require migration or cleanup outside this change