Uh oh!
There was an error while loading. Please reload this page.
fix(server): start-from-origin worktrees no longer wait on a full git fetch - #8393
fix(server): start-from-origin worktrees no longer wait on a full git fetch#8393gsimone wants to merge 4 commits into
Conversation
… fetch A hanging `git fetch origin` aborted new worktree threads even when origin/<branch> already existed locally. Resolve that tracking commit first, and fetch only that one branch when it is missing. Co-authored-by: Cursor <cursoragent@cursor.com>
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Uh oh!
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Would Approve Macroscope's review found this PR approvable — This is a narrowly scoped server bug fix that replaces the unconditional full origin fetch with local tracking-commit resolution and a targeted fallback fetch, with focused bootstrap tests. The supplied high-severity finding concerns remote-qualified refs; the head includes normalization and coverage for that case, though the finding remains an independent threshold blocker. Not approved because:
Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more. |
Remote-qualified base branches like origin/release were fetched as refs/heads/origin/release, so bootstrap aborted when the tracking ref was missing. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
git fetch origin(every remote branch) under the default 30s timeout. A slow full fetch aborted the new thread even whenorigin/<branch>was already on disk.fetchRemoteTrackingBranch). A failed narrow fetch still fails the dispatch and rolls the provisional thread back — it does not silently fall back to localmain.Test plan
origin/mainpresent: worktree is created without waiting on a fullgit fetch originorigin/mainmissing locally: only that branch is fetched, then the worktree is createdoriginremote still uses the local base branchFocused:
vp test run apps/server/src/server.test.ts -t "bases a start-from-origin|fetches only the requested origin|fails start-from-origin|falls back to the local base|bootstraps first-send worktree"Generated with Cursor Grok 4.6.
Made with Cursor
Note
Avoid full
git fetchfor start-from-origin worktree bootstrapfetchRemoteTrackingBranchtoGitWorkflowServiceso callers can fetch a single remote branch on demandstartFromOriginis true, the server now resolves the localorigin/<base>commit first; if missing, it fetches only that branch viafetchRemoteTrackingBranchand resolves the commit, instead of doing an unconditional full remote fetchorigin/<base>ref is stale, the worktree is based on that stale commit rather than refreshing the entire remoteMacroscope summarized e084b1a.