private function guardCommitsBetweenLocalBranchAndRemoteBaseBranch($org, $repo, $branch, $sourceBranch)
    {
        /** @var GitHelper $gitHelper */
        $gitHelper = $this->getHelper('git');

        if (!$commitCount = $gitHelper->getCommitCountBetweenLocalAndBase($org, $branch, $sourceBranch)) {
            throw new UserException(
                sprintf('Cannot open pull-request because there are no commits between current branch ("%s") and "%s/%s:%s".', $sourceBranch, $org, $repo, $branch)
            );
        }

        return $commitCount;
    }