pub fn issue_of(branch: &str, ids: &[String]) -> Option<String>Expand description
The issue a branch provably names: a path component equal to an issue id, or beginning
with the id followed by -. Nothing else counts.
use majordomus_cli::worktree::state::issue_of;
let ids = vec!["I0042".to_string(), "I1003".to_string()];
assert_eq!(issue_of("feature/I1003-graph-kinds", &ids).as_deref(), Some("I1003"));
assert_eq!(issue_of("fix/I0042", &ids).as_deref(), Some("I0042"));
assert_eq!(issue_of("feature/graph-kinds", &ids), None);
assert_eq!(issue_of("feature/I10030", &ids), None);