Skip to content

fix(nlab-api): fetch target branches outside configured refspecs - #111

Merged
JacobZyy merged 1 commit into
mainfrom
codex/nlab-target-branch
Sep 29, 2026
Merged

JacobZyy merged 1 commit into
mainfrom
codex/nlab-target-branch

Conversation

@JacobZyy

Copy link
Copy Markdown
Owner

Repositories cloned with --single-branch could report an existing target branch as missing because fetching origin honored the restricted fetch refspec. Creating a tracking branch also failed when the requested branch was outside that refspec.

Fetch the requested branch into its explicit remote-tracking ref and create the local branch with --no-track. Existing explicit fast-forward pulls continue to update it. Preserve the repository's fetch configuration and existing worktree protections. The shared repository path covers initialization, generation, and Discover.

Validation:

  • Reproduced the original failure with a single-branch clone regression, then verified branch creation, subsequent updates, unchanged fetch configuration, and failure without switching when a branch is absent.
  • Rust formatting, Clippy with warnings denied, and all 389 Rust tests passed.
  • Documentation build passed.

@JacobZyy
JacobZyy merged commit f682886 into main Sep 29, 2026
2 checks passed
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