Skip to main content

fetch_branch

Function fetch_branch 

Source
pub fn fetch_branch(
    repo: &Repository,
    remote_name: &str,
    branch: &str,
) -> Result<()>
Expand description

Fetch branch from remote_name, making it available as refs/remotes/{remote_name}/{branch}.

This is used for both fork and non-fork PRs to fetch the PR’s head branch identified via gh CLI metadata. If the ref already exists locally the fetch is skipped.