private function loadCommitList(Environment $environment, Commit $startCommit, $limit = 10)
    {
        /** @var Commit[] $commits */
        $commits = [$startCommit];
        if (!count($startCommit->parents) || $limit === 1) {
            return $commits;
        }

        /** @var \Platformsh\Cli\Service\GitDataApi $gitData */
        $gitData = $this->getService('git_data_api');

        $progress = new ProgressBar($this->stdErr->isDecorated() ? $this->stdErr : new NullOutput());
        $progress->setMessage('Loading...');
        $progress->setFormat('%message% %current% (limit: %max%)');
        $progress->start($limit);
        for ($currentCommit = $startCommit;
             count($currentCommit->parents) && count($commits) < $limit;) {
            foreach (array_reverse($currentCommit->parents) as $parentSha) {
                if (!isset($commits[$parentSha])) {
                    $commits[$parentSha] = $gitData->getCommit($environment, $parentSha);
                }
                $currentCommit = $commits[$parentSha];
                $progress->advance();
            }
        }
        $progress->clear();

        return $commits;
    }
private function loadCommitList(Environment $environment, Commit $startCommit, $limit = 10)
    {
        /** @var Commit[] $commits */
        $commits = [$startCommit];
        if (!count($startCommit->parents) || $limit === 1) {
            return $commits;
        }

        /** @var \Platformsh\Cli\Service\GitDataApi $gitData */
        $gitData = $this->getService('git_data_api');

        $progress = new ProgressBar($this->stdErr->isDecorated() ? $this->stdErr : new NullOutput());
        $progress->setMessage('Loading...');
        $progress->setFormat('%message% %current% (limit: %max%)');
        $progress->start($limit);
        for ($currentCommit = $startCommit;
             count($currentCommit->parents) && count($commits) < $limit;) {
            foreach (array_reverse($currentCommit->parents) as $parentSha) {
                if (!isset($commits[$parentSha])) {
                    $commits[$parentSha] = $gitData->getCommit($environment, $parentSha);
                }
                $currentCommit = $commits[$parentSha];
                $progress->advance();
            }
        }
        $progress->clear();

        return $commits;
    }
private function loadCommitList ( Environment $ environment , Commit $ startCommit , $ limit = 10 ) { /** @var Commit[] $commits */ $ commits = [ $ startCommit ] ; if ( ! count ( $ startCommit -> parents ) || $ limit === 1 ) { return $ commits ; } /** @var \Platformsh\Cli\Service\GitDataApi $gitData */ $ gitData = $ this -> getService ( 'git_data_api' ) ; $ progress = new ProgressBar ( $ this -> stdErr -> isDecorated ( ) ? $ this -> stdErr : new NullOutput ( ) ) ; $ progress -> setMessage ( 'Loading...' ) ; $ progress -> setFormat ( '%message% %current% (limit: %max%)' ) ; $ progress -> start ( $ limit ) ; for ( $ currentCommit = $ startCommit ; count ( $ currentCommit -> parents ) && count ( $ commits ) < $ limit ; ) { foreach ( array_reverse ( $ currentCommit -> parents ) as $ parentSha ) { if ( ! isset ( $ commits [ $ parentSha ] ) ) { $ commits [ $ parentSha ] = $ gitData -> getCommit ( $ environment , $ parentSha ) ; } $ currentCommit = $ commits [ $ parentSha ] ; $ progress -> advance ( ) ; } } $ progress -> clear ( ) ; return $ commits ; }
Load parent commits, recursively, up to the limit.

@param \Platformsh\Client\Model\Environment $environment
@param \Platformsh\Client\Model\Git\Commit  $startCommit
@param int                                  $limit

@return \Platformsh\Client\Model\Git\Commit[]
Load parent commits recursively up to the limit .