check_ancestry

Function check_ancestry 

Source
fn check_ancestry(
    github: &GithubClient,
    local_hash: &str,
    remote_hash: &str,
) -> Result<VersionComparison, VersionError>
Expand description

Checks commit ancestry using GitHub’s compare API.

Makes a request to GitHub’s compare endpoint to determine if local_hash is ahead of, behind, or diverged from remote_hash.

§Arguments

  • github - GitHub client for making API requests
  • local_hash - The local commit hash to compare
  • remote_hash - The remote commit hash to compare against

§Errors

Returns VersionError::GitHubApi if:

  • The HTTP request fails
  • GitHub returns a non-success status code
  • The response cannot be parsed