Skip to content

fix(sidecar): recover origin via git commands, tolerate unborn HEAD - #54

Merged
ExtraToast merged 1 commit into
mainfrom
fix/sidecar-command-recovery
Sep 10, 2026
Merged

ExtraToast merged 1 commit into
mainfrom
fix/sidecar-command-recovery

Conversation

@ExtraToast

Copy link
Copy Markdown
Contributor

fix(sidecar): recover origin via git commands, tolerate unborn HEAD

GitPython's remote API is unreliable on a partially-initialised repo: the
remotes["origin"] lookup can raise even when origin is in .git/config, and
git remote add fails with 'already exists' when origin is registered but not
indexed. Drive the attach recovery with git remote/fetch/checkout commands
instead. Also tolerate an unborn HEAD (fresh Repo.init has no commits) when
checking the current branch.

Verified: 14 tests pass, ruff + mypy clean.

GitPython's remote API is unreliable on a partially-initialised repo: the
remotes["origin"] lookup can raise even when origin is in .git/config, and
git remote add fails with 'already exists' when origin is registered but not
indexed. Drive the attach recovery with git remote/fetch/checkout commands
instead. Also tolerate an unborn HEAD (fresh Repo.init has no commits) when
checking the current branch.

Verified: 14 tests pass, ruff + mypy clean.
@ExtraToast ExtraToast added type: bug Something is broken or behaving incorrectly. area: knowledge Knowledge base, recall, capture, or curation. priority: P1 High; important and should be handled in the current iteration. labels Sep 10, 2026
@ExtraToast
ExtraToast merged commit 801b51a into main Sep 10, 2026
14 checks passed
@ExtraToast
ExtraToast deleted the fix/sidecar-command-recovery branch September 10, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: knowledge Knowledge base, recall, capture, or curation. priority: P1 High; important and should be handled in the current iteration. type: bug Something is broken or behaving incorrectly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant