def METHOD_NAME(self, repo, start_sha, end_sha):
    installation = self.get_installation(repo.integration_id, repo.organization_id)
    client = installation.get_client()
    # use config name because that is kept in sync via webhooks
    name = repo.config["name"]
    if start_sha is None:
        try:
            res = client.get_last_commits(name, end_sha)
        except Exception as e:
            installation.raise_error(e)
        else:
            return self._format_commits(repo, res[:10])
    else:
        try:
            res = client.METHOD_NAME(name, start_sha, end_sha)
        except Exception as e:
            installation.raise_error(e)
        else:
            return self._format_commits(repo, res)