def diverge(self, upstream, branch):
        reference = "{}/{}".format(upstream, branch)
        remote_branch = self.lookup_branch(reference, GIT_BRANCH_REMOTE)
        local_branch = self.lookup_branch(branch, GIT_BRANCH_LOCAL)

        if remote_branch.target == local_branch.target:
            return False, False

        diverge_commits = self.find_diverge_commits(local_branch,
                                                    remote_branch)
        behind = len(diverge_commits.second_commits) > 0
        ahead = len(diverge_commits.first_commits) > 0

        return ahead, behind
dataset/ETHPy150Open PressLabs/gitfs/gitfs/repository.py/Repository.diverge/original