pub fn validate_ref(r: &str) -> Result<()>
A branch, tag or SHA, as git’s check-ref-format would take it, minus anything that could read as an option.