Skip to main content

prepare_pr_worktree

Function prepare_pr_worktree 

Source
pub fn prepare_pr_worktree(
    repo: &Repository,
    pr_number: u32,
    pr_format: &str,
) -> Result<(String, String, String)>
Expand description

Prepare everything needed to create a worktree for PR pr_number.

Orchestrates the complete PR workflow:

  1. Checks that gh CLI is available
  2. Fetches PR metadata via gh
  3. Sets up a fork remote if the PR is cross-repository
  4. Fetches the PR’s head branch
  5. Formats the worktree name using pr_format

Returns (worktree_name, remote_ref, base_branch) ready for add_worktree.