pub fn parse_verify_target(raw_target: &str) -> VerifyTargetExpand description
Determine whether raw_target is a Git reference or an attestation path.
Rules (evaluated in order):
- “-” → stdin attestation
- Path exists on disk → attestation file
- Contains “..” (range notation) → git ref
- Is “HEAD” or matches ^[0-9a-f]{4,40}$ → git ref
- Otherwise → git ref (assume the user knows what they’re typing)
Args:
raw_target- Raw CLI input string.
Usage:
ⓘ
let t = parse_verify_target("HEAD");
assert!(matches!(t, VerifyTarget::GitRef(_)));