Skip to main content

first_merge

Function first_merge 

Source
pub fn first_merge(text: &str) -> Option<(String, String)>
Expand description

The first merge commit of a rev-list --parents --reverse --ancestry-path listing, with its first parent. A listing whose first entry has one parent is a branch that reached the trunk without a merge of its own.

use majordomus_cli::worktree::first_merge;
assert_eq!(first_merge("m p1 p2\nx m\n"), Some(("m".into(), "p1".into())));
assert!(first_merge("ff p\n").is_none());
assert!(first_merge("").is_none());