protected function postCloneSetup(Builder $builder, $cloneTo)
    {
        $buildType = $this->getExtra('build_type');

        $success = true;

        try {
            if (!empty($buildType) && $buildType == 'pull_request') {
                $remoteUrl = $this->getExtra('remote_url');
                $remoteBranch = $this->getExtra('remote_branch');

                $cmd = 'cd "%s" && git checkout -b phpci/' . $this->getId() . ' %s && git pull -q --no-edit %s %s';
                if ($this->canRunSsh()) {
                    $success = $this->runBySsh($builder, $cloneTo, $cmd, [$cloneTo, $this->getBranch(), $remoteUrl, $remoteBranch]);
                } else {
                    $success = $builder->executeCommand($cmd, $cloneTo, $this->getBranch(), $remoteUrl, $remoteBranch);
                }
            }
        } catch (\Exception $ex) {
            $success = false;
        }

        if ($success) {
            $success = parent::postCloneSetup($builder, $cloneTo);
        }

        return $success;
    }
protected function postCloneSetup(Builder $builder, $cloneTo)
    {
        $buildType = $this->getExtra('build_type');

        $success = true;

        try {
            if (!empty($buildType) && $buildType == 'pull_request') {
                $remoteUrl = $this->getExtra('remote_url');
                $remoteBranch = $this->getExtra('remote_branch');

                $cmd = 'cd "%s" && git checkout -b phpci/' . $this->getId() . ' %s && git pull -q --no-edit %s %s';
                if ($this->canRunSsh()) {
                    $success = $this->runBySsh($builder, $cloneTo, $cmd, [$cloneTo, $this->getBranch(), $remoteUrl, $remoteBranch]);
                } else {
                    $success = $builder->executeCommand($cmd, $cloneTo, $this->getBranch(), $remoteUrl, $remoteBranch);
                }
            }
        } catch (\Exception $ex) {
            $success = false;
        }

        if ($success) {
            $success = parent::postCloneSetup($builder, $cloneTo);
        }

        return $success;
    }
protected function postCloneSetup ( Builder $ builder , $ cloneTo ) { $ buildType = $ this -> getExtra ( 'build_type' ) ; $ success = true ; try { if ( ! empty ( $ buildType ) && $ buildType == 'pull_request' ) { $ remoteUrl = $ this -> getExtra ( 'remote_url' ) ; $ remoteBranch = $ this -> getExtra ( 'remote_branch' ) ; $ cmd = 'cd "%s" && git checkout -b phpci/' . $ this -> getId ( ) . ' %s && git pull -q --no-edit %s %s' ; if ( $ this -> canRunSsh ( ) ) { $ success = $ this -> runBySsh ( $ builder , $ cloneTo , $ cmd , [ $ cloneTo , $ this -> getBranch ( ) , $ remoteUrl , $ remoteBranch ] ) ; } else { $ success = $ builder -> executeCommand ( $ cmd , $ cloneTo , $ this -> getBranch ( ) , $ remoteUrl , $ remoteBranch ) ; } } } catch ( \ Exception $ ex ) { $ success = false ; } if ( $ success ) { $ success = parent :: postCloneSetup ( $ builder , $ cloneTo ) ; } return $ success ; }
Handle any post-clone tasks, like applying a pull request patch on top of the branch.
@param Builder $builder
@param $cloneTo
@return bool
Handle any post - clone tasks like applying a pull request patch on top of the branch .