fix: use working clones for git repos
- 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
This commit is contained in:
@@ -346,7 +346,20 @@ def list_branches(repo_path: str) -> tuple[list[BranchInfo], str]:
|
||||
)
|
||||
default_branch = branch_name
|
||||
except RuntimeError:
|
||||
pass
|
||||
try:
|
||||
output = _run_git_command(repo_path, "symbolic-ref", "--short", "HEAD")
|
||||
branch_name = output.strip()
|
||||
if branch_name:
|
||||
branches.append(
|
||||
BranchInfo(
|
||||
name=branch_name,
|
||||
is_default=True,
|
||||
last_commit=None,
|
||||
)
|
||||
)
|
||||
default_branch = branch_name
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
return branches, default_branch
|
||||
|
||||
|
||||
Reference in New Issue
Block a user