Skip to main content

upstream_ref_deleted

Function upstream_ref_deleted 

Source
fn upstream_ref_deleted(path: &Path) -> bool
Expand description

Whether the branch’s configured upstream names a remote ref that no longer exists.

push -u writes the upstream only after a successful push, so the branch was on that remote and its remote branch has since been deleted - the shape a squash-merged PR leaves once the branch is pruned. Neither reachability nor the upstream can see a squash by sha, and by then the remote branch is normally gone.

This trusts -u: an upstream configured by hand against a ref that was never fetched reads as deleted. Proceeding still loses nothing, because the despawn’s branch reap keeps a local branch holding commits no other ref reaches, and reports it.