Skip to content

review-branch skill validation fails for unfetched remote refs in worktrees #442

@cderv

Description

@cderv

The review-branch skill's input validation (step 1) runs git rev-parse --verify -- <branch> to check that the --base ref is valid before proceeding. This fails when the ref is a remote tracking branch that hasn't been fetched locally yet — common in worktrees where remote refs may not be present.

Observed twice when running from a Claude Code worktree:

$ git rev-parse --verify -- upstream/main
fatal: Needed a single revision

The skill spec says to abort on validation failure, but in practice Claude improvised a fetch + retry:

$ git fetch upstream main
$ git rev-parse --verify upstream/main
aef54133cf0b3f621243cbd5d7ad90e642cad819

This recovery isn't guaranteed — it depends on the model choosing to retry rather than following the "do not proceed" instruction.

The validation step could handle remote refs (matching <remote>/<branch>) by fetching before validating, or by skipping the strict check for refs that look like remote tracking branches and letting roborev review --base handle validation itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions