Skip to main content

push_pinned

Function push_pinned 

Source
pub async fn push_pinned(
    repo: &Path,
    remote: &str,
    branch: &str,
    expected: &str,
) -> Result<GitOut>
Expand description

Force-push branch only if remote still has it at expected.

The lease is pinned to a sha the caller read itself, not to whatever the remote-tracking ref says at push time: a fetch in between moves the tracking ref, and a bare lease would then be measured against the very commit it was meant to protect a person’s push from. A remote that has moved on refuses the push, so a concurrent push fails the step instead of being lost.