def get_compare_status(repo: Repository, fork: Repository, head: str) -> str: """ Compares a branch in a fork to the origin's default branch. :return: Status of the compared branch """ label = construct_fork_label(fork, head) compare = repo.compare(repo.default_branch, label) return compare.status
def get_compare_status(repo: Repository, fork: Repository, head: str) -> str: """ Compares a branch in a fork to the origin's default branch. :return: Status of the compared branch """ label = construct_fork_label(fork, head) try: compare = repo.compare(repo.default_branch, label) return compare.status except GithubException: # Because each head that is not "diverged" is removed, # the exact return make no difference here, like # if GithubException.status == "404": return GithubException.data