Skip to main content

resolve_pushed_sha

Function resolve_pushed_sha 

Source
async fn resolve_pushed_sha(
    cwd: &Path,
    cap: usize,
    budget: Duration,
) -> Option<String>
Expand description

Resolve HEAD’s newest pushed ancestor: walk HEAD’s first-parent history newest-first (bounded by cap) and stop at the first sha the remote-tracking refs already contain. None when nothing of HEAD’s ancestry is pushed or no remote refs exist (a truthful negative); a git failure also yields None but is an UNRESOLVABLE lookup, not a negative - the row may flicker off for one scan while git is broken and recovers on the next scan. The walk happens inside git so a worktree ahead of the PR tip by unpushed commits still resolves the commit the PR was pushed from.