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:
2026-05-22 19:54:42 +02:00
parent 2525c58471
commit 4547105f3b
10 changed files with 215 additions and 38 deletions
@@ -63,6 +63,13 @@ class TestGitStatus:
assert "new.py" in status.untracked
def test_get_current_branch_handles_unborn_main() -> None:
with tempfile.TemporaryDirectory() as tmpdir:
os.system(f"git init -b main {tmpdir} >/dev/null 2>&1")
assert get_current_branch(tmpdir) == "main"
class TestBranchOperations:
"""Tests for branch management functions."""