Pull changes from a remote

@param $remote string|NULL
@param $params array|NULL

@return static
@throws ShellException
326300
public function pullWithInfo($remote = null) {
		$result = $this->extractFromCommand("git pull $remote", 'trim');
		$result = implode(PHP_EOL, $result);
		$result = trim($result);
		return $result;
	}
102359
public function getChanges(array $params = [])
    {
        $path = '/'.$this->databaseName.'/_changes';

        $method = ((!isset($params['doc_ids']) || $params['doc_ids'] == null) ? 'GET' : 'POST');
        $response = '';

        if ($method == 'GET') {
            foreach ($params as $key => $value) {
                if (isset($params[$key]) === true && is_bool($value) === true) {
                    $params[$key] = ($value) ? 'true' : 'false';
                }
            }
            if (count($params) > 0) {
                $query = http_build_query($params);
                $path = $path.'?'.$query;
            }
            $response = $this->httpClient->request('GET', $path);
        } else {
            $path .= '?filter=_doc_ids';
            $response = $this->httpClient->request('POST', $path, json_encode($params));
        }
        if ($response->status != 200) {
            throw HTTPException::fromResponse($path, $response);
        }

        return $response->body;
    }
1328686
public function addRemote($name, $url, array $params = null) {
		return $this
			->begin()
			->run('git remote add', $params, $name, $url)
			->end();
	}
257451
public function loadTypeDataByRemoteId($remoteId, $status)
    {
        $q = $this->getLoadTypeQueryBuilder();
        $q
            ->where($q->expr()->eq('c.remote_id', ':remote'))
            ->andWhere($q->expr()->eq('c.version', ':version'))
            ->setParameter('remote', $remoteId, ParameterType::STRING)
            ->setParameter('version', $status, ParameterType::INTEGER);

        return $q->execute()->fetchAll();
    }
711407
public function execGET($url, array $params = [])
    {
        $url = $this->baseUrl . $url;

        // Build the query from the parameters
        if ($params !== []) {
            $url .= '?' . http_build_query($params);
        }

        // Set request options
        $this->addOptions([
            CURLOPT_URL => $url,
            CURLOPT_HTTPGET => true,
        ]);

        return $this->exec();
    }
1045010
public function push($remote = 'origin')
    {
        if (!$this->hasCheckout) {
            throw new \RuntimeException('This operation requires an active checkout.');
        }

        try {
            return $this->execute('push', array('--porcelain' => true, $remote));
        } catch (\RuntimeException $e) {
            // ignore output on stderr: it contains
            // progress information, for example about hooks
        }

        return null;
    }
192451
public function get_remote_api_changes( $git, $changes, $request ) {
		$response = isset( $this->response['changes'] ) ? $this->response['changes'] : false;

		// Set $response from local file if no update available.
		if ( ! $response && ! $this->can_update_repo( $this->type ) ) {
			$response = $this->get_local_info( $this->type, $changes );
		}

		if ( ! $response ) {
			self::$method = 'changes';
			$response     = $this->api( $request );
			$response     = $this->decode_response( $git, $response );
		}

		if ( ! $response && ! is_wp_error( $response ) ) {
			$response          = new \stdClass();
			$response->message = 'No changelog found';
		}

		if ( $this->validate_response( $response ) ) {
			return false;
		}

		if ( $response && ! isset( $this->response['changes'] ) ) {
			$parser   = new \Parsedown();
			$response = $parser->text( $response );
			$this->set_repo_cache( 'changes', $response );
		}

		$this->type->sections['changelog'] = $response;

		return true;
	}
744650
public function show(string $change, array $params = [])
    {
        $path = $this->buildChangesPath($change);

        return $this->get($path, $params);
    }
28652
final public static function execute(Parameters $params) {

        if ( $params->protocol() != RpcServer::XMLRPC ) {

            throw new RpcException($params->errors()->get(-31000), -31000);

        }

        $boxcarred_requests = $params->get('requests');

        $results = [];

        foreach ( $boxcarred_requests as $position => $request ) {

            $new_parameters = new Parameters(
                $params->capabilities(),
                $params->methods(),
                $params->errors(),
                $params->logger(),
                $params->protocol()
            );

            $results[$position] = self::singleCall($request, $new_parameters);

        }

        return $results;

    }
1049148
public PullResult pullFromRepository(Git git, String remote, String remoteBranch) {
        try {
            return git.pull()
                .setRemote(remote)
                .setRemoteBranchName(remoteBranch)
                .call();
        } catch (GitAPIException e) {
            throw new IllegalStateException(e);
        }
    }
96630
public static function get($params = null, $client = null) {
    return new self(self::_uriWithParams('/export_dates', $params), $client);
  }
851301
public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof RemoteAppQuery) {
            return $criteria;
        }
        $query = new RemoteAppQuery(null, null, $modelAlias);

        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }
895488
public function get($remotePathname, $localPathname)
    {
        if (!$this->getScp()->get($remotePathname, $localPathname)) {
            throw new \RuntimeException(sprintf('Unable to get file "%s".', $remotePathname));
        }

        return $this;
    }
280164
public function execute($remote, $url)
    {
        $process = new Process(sprintf('./%s %s %s', 'pre-push-original', $remote, $url));
        $process->run();
        
        return $process->getOutput();
    }
641845
public function ensureNotesFetching($remote)
    {
        $fetches = StringUtil::splitLines(
            $this->getGitConfig('remote.'.$remote.'.fetch', 'local', true)
        );

        if (!in_array('+refs/notes/*:refs/notes/*', $fetches, true)) {
            $this->getHelperSet()->get('gush_style')->note(
                sprintf('Set fetching of notes for remote "%s".', $remote)
            );

            $this->processHelper->runCommand(
                ['git', 'config', '--add', '--local', 'remote.'.$remote.'.fetch', '+refs/notes/*:refs/notes/*']
            );
        }
    }
523562
public function update($params, $optParams = [])
    {
        if (!$params instanceof Cloud) {
            throw new InvalidParamException(Cloud::class . ' is required!');
        }

        return $this->sendRequest([], [
            'restAction' => 'update',
            'restId' => $params->id,
            'postParams' => $params->toArray(),
            'getParams' => $optParams,
        ], function ($response) {
            return isset($response->data) ? new Cloud($response->data) : $response;
        });
    }
318589
private function exec($command, $params = []) {
        if (in_array($command, $this->available_commands)) {
            // convert json to array then get the last messages info
            $output = json_decode($this->curl_get_contents($this->api . '/' . $command, $params), true);

            return $this->convertToObject($output);
        } else {
            echo 'command not found';
        }
    }