Skip to main content

off_default_history

Function off_default_history 

Source
pub fn off_default_history(root: &Path) -> Result<Option<String>>
Expand description

Whether HEAD is off the default-branch history: None when the default branch contains HEAD, or why it does not, naming both commits.

Being off the branch is a finding the caller may allow. A missing fact is not a finding: a proof that cannot run fails and names the missing fact. A check that passed by skipping itself would let a release run from any commit, in exactly the CI shapes where the proof matters.

Each of these fails:

  • no repository;
  • no HEAD commit;
  • no origin remote;
  • an origin with no peelable default-tracking ref;
  • a shallow clone that cannot walk the graph.

ยงErrors

Returns an error when:

  • no repository covers root;
  • HEAD has no commit;
  • there is no origin remote;
  • resolving the default branch ref fails;
  • the merge-base cannot be computed, as in a shallow clone.