Skip to main content

get_ref_ahead_behind

Function get_ref_ahead_behind 

Source
pub async fn get_ref_ahead_behind(
    repo_path: PathBuf,
    left_ref: String,
    right_ref: String,
) -> Result<(u32, u32), GitError>
Expand description

Re-exported commit/sync/diff APIs. Returns the number of commits left_ref is ahead of and behind right_ref.

The returned tuple is (ahead, behind), where ahead counts commits reachable from left_ref but not right_ref, and behind counts commits reachable from right_ref but not left_ref.

ยงErrors

Returns a GitError if git rev-list fails or returns unexpected output.