Skip to content

fix: only treat a missing branch as a new branch on clone (0.9) - #71

Merged
EdmondDantes21 merged 1 commit into
release-0.9from
fix/clone-only-orphan-on-missing-branch-0.9
Oct 15, 2026
Merged

EdmondDantes21 merged 1 commit into
release-0.9from
fix/clone-only-orphan-on-missing-branch-0.9

Conversation

@EdmondDantes21

Copy link
Copy Markdown
Contributor
  • Since 0.9.3, any failure of the remote branch lookup in Clone (network blip, 5xx, rate limit) is treated as "branch does not exist": the existing branch is checked out as an orphan, RemoveGlob("*") empties it, and the next commit deletes every target file not in the template.
  • Backports the guard from main (Add integration coverage and support for templating engine annotation #68): GetLatestCommitRemote wraps ErrBranchNotFound, and Clone returns any other error so the reconcile retries.
  • Tests: TestCloneFailsOnTransientBranchLookupError (git HTTP server that fails the first request; fails without the fix) and TestGetLatestCommitRemoteBranchNotFound.
  • Verified on kind against an in-cluster server that drops the lookup (0.9.4 lost existing files 3/3, this build 0/3) and against GitHub repos.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant