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;
    }
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;
    }
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 ; }
Gets the number of commits between local and base branch, failing if there
isn't any.

@param string $org
@param string $repo
@param string $branch
@param string $sourceBranch

@throws UserException If there aren't commits between local and base branch

@return int The number of commits between local and base branch
Gets the number of commits between local and base branch failing if there isn t any .