Starting a worktree thread in a repo with no origin remote failed outright: the "start from origin" default made bootstrap run git fetch origin, which errors when the remote doesn't exist.
Bootstrap now checks whether origin exists first. If it does, behavior is unchanged (fetch, resolve the remote tracking commit, branch from it). If it doesn't, the worktree branches from the local base branch instead of failing the whole thread.
- New
remoteExists on GitVcsDriver/GitWorkflowService (the existing originRemoteExists helper now delegates to it)
ws.ts bootstrap only takes the origin path when the remote is present
- Server tests cover both the origin and no-origin paths
Written by Claude Fable 5 via Claude Code.
Note
Low Risk
Localized bootstrap/git workflow change with tests; no auth or data-path impact.
Overview
Thread bootstrap no longer fails when start from origin is enabled but the repo has no origin remote. Worktree preparation now calls remoteExists first; only then does it fetch and resolve the remote-tracking base commit.
A generic remoteExists API is added on GitVcsDriver and GitWorkflowService (the internal originRemoteExists helper delegates to it). Server tests assert the origin path still runs fetch/resolve when the remote exists, and that missing origin skips fetch and creates the worktree from the local base branch.
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2a0c57695d15718115e3b3bc6d7e6667207a21c7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
Note
Skip origin fetch when creating worktrees in repos without an origin remote#
- Adds
remoteExists({ cwd, remoteName }) to GitVcsDriver and GitWorkflowService, implemented via git remote get-url <remoteName> with a non-zero exit allowed.
- Refactors
originRemoteExists in GitVcsDriverCore.ts to delegate to the new generic method.
- In ws.ts, the bootstrap
prepareWorktree path now checks for the origin remote before fetching; if absent, it falls back to the local base branch ref instead of attempting a fetch that would fail.
Macroscope summarized 2a0c576.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
05feb627-cb1c-4992-9b62-dcb6f9161567You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share