Skip to main content

merge_base

Function merge_base 

Source
pub fn merge_base(
    repo: &Path,
    a: &str,
    b: &str,
) -> Result<Option<String>, String>
Expand description

git merge-base a b, or None when they share none.

The first base is taken when there are several. Criss-cross histories have more than one and git’s own recursive strategy synthesises a merge of them; approximating that with the first is a known imprecision, and it biases toward findings rather than away, which is the direction that gets looked at rather than believed.

§Errors

Never: a merge base git cannot produce is None, which the caller counts as a skip.