forked from toolshed/abra
Fetch and resolve a branch name on demand (into refs/remotes/origin/*, never refs/heads/*, to avoid corrupting default-branch detection), checking it out detached at its tip as a chaos commit. Resolution order stays tag -> hash -> branch so existing pins are unaffected. Adds EnsureVersionCtx so offline mode fails clearly instead of hanging or erroring opaquely when a branch hasn't been fetched yet. This supersedes the previous behavior of rejecting branch names with a clear error. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y6PrSttbx61PCQTie7HzLg