Skip to main content

parse_commit

Function parse_commit 

Source
pub fn parse_commit(line: &str) -> Option<CommitRef>
Expand description

Parse one commit line of FORMAT. A line with fewer fields is not a commit.

use majordomus_cli::worktree::parse_commit;
let c = parse_commit("abc123\0abc\0A Person\02026-09-09T10:00:00+02:00\0feat: a thing").unwrap();
assert_eq!(c.short, "abc");
assert_eq!(c.subject, "feat: a thing");
assert!(parse_commit("abc123").is_none());