Skip to main content

attest

Function attest 

Source
pub fn attest(repo: &Path, command: &str) -> Result<Attestation>
Expand description

Run command in repo and, when it passes, write the branch’s receipt to repo/RECEIPTS_DIR/<branch_slug>.json and commit it. Returns the attestation either way.

The commit only ever adds: every other branch’s receipt, and any retired single-file attestation, is left exactly where it is. See the write site for why a paired delete is unsafe.

A receipt records a run that passed, so a non-zero command leaves the receipts directory exactly as it was — the branch’s earlier receipt, if any, stays committed and unmodified. The returned Attestation::exit_code carries the failure for the caller to propagate.