Skip to content

Add --ref support to repo checkout#1988

Open
princepal9120 wants to merge 1 commit intomultica-ai:mainfrom
princepal9120:prince/repo-checkout-ref
Open

Add --ref support to repo checkout#1988
princepal9120 wants to merge 1 commit intomultica-ai:mainfrom
princepal9120:prince/repo-checkout-ref

Conversation

@princepal9120
Copy link
Copy Markdown
Contributor

@princepal9120 princepal9120 commented May 1, 2026

This adds an optional --ref flag to multica repo checkout so an agent can check out a branch, tag, or commit directly instead of always starting from the repo default branch.

That matters for review and QA flows where the target revision is already known. Without this, the agent has to mutate the checked-out worktree after the daemon creates it, which is fragile and can leave the daemon's repo metadata out of sync.

What changed:

  • multica repo checkout <url> --ref <branch-or-sha> now passes the requested ref to the daemon.
  • The repo cache resolves branch names, tags, and commit SHAs before creating the worktree.
  • Runtime instructions mention --ref for review/QA tasks.
  • Added coverage for branch refs, commit refs, and unknown refs.

Fixes #1869.

This also helps #1898 because agents can request the exact branch or commit up front instead of running a separate git checkout inside a daemon-owned worktree.

Validation:

go test ./internal/daemon/repocache ./cmd/multica ./internal/daemon ./internal/daemon/execenv

@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

@princepal9120 is attempting to deploy a commit to the IndexLabs Team on Vercel.

A member of the Team first needs to authorize it.

@princepal9120 princepal9120 changed the title feat: allow repo checkout at a specific ref Add --ref support to repo checkout May 1, 2026
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.

[Feature]: git clone/ worktree 是否能指定分支

1 participant