Skip to main content

advance_local_branch

Function advance_local_branch 

Source
pub async fn advance_local_branch(repo_dir: &Path, branch: &str) -> Result<()>
Expand description

Advance the local branch ref to match origin/<branch> after a fetch.

If the branch is currently checked out, uses merge --ff-only so the working tree stays in sync. Otherwise updates the ref directly after verifying the move is a fast-forward. Errors are non-fatal for the pipeline (which only needs origin/<branch>), but keeping the local branch current avoids surprise “behind by N commits” messages.