build_helper::git

Function git_upstream_merge_base

source
fn git_upstream_merge_base(
    config: &GitConfig<'_>,
    git_dir: Option<&Path>,
) -> Result<String, String>
Expand description

Finds the nearest merge commit by comparing the local HEAD with the upstream branch’s state. To work correctly, the upstream remote must be properly configured using git remote add <name> <url>. In most cases get_closest_merge_commit is the function you are looking for as it doesn’t require remote to be configured.