Update an repo

@param Repo $repo
@return mixex
480968
public function update(Repo $repo)
    {
        $rows = array();

        foreach ($this->getRows() as $row) {
            if ($row['id'] == $repo->getId()) {
                $row = array(
                    'slug' => $repo->getSlug(),
                    'qualityBadgeHash' => $repo->getQualityBadgeHash(),
                    'coverageBadgeHash' => $repo->getCoverageBadgeHash(),
                    'type' => $repo->getType(),
                    'id' => $repo->getId()
                );
            }
            $rows[] = $row;
        }

        file_put_contents($this->filename, Yaml::dump($rows));
    }
512889
def git_update(repo, options = {})
      ensure_ready!(:authorization)
      response = connection.patch(git_repo_path(repo), options)
      checked_response_body(response)
    end
49618
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
    {
        new Textpattern();
        parent::update($repo, $initial, $target);
        $plugin = new $this->textpatternPackager($this->getInstallPath($target), $target);
        $plugin->update();
    }
179765
def update_version(self, version, step=1):
        ""

        # update the version based on the flags passed.
        if self.config.patch:
            version.patch += step
        if self.config.minor:
            version.minor += step
        if self.config.major:
            version.major += step
        if self.config.build:
            version.build_number += step
        if self.config.build_number:
            version.build_number = self.config.build_number

        # create a new tag in the repo with the new version.
        if self.config.dry_run:
            log.info('Not updating repo to version {0}, because of --dry-run'.format(version))
        else:
            version = self.call_plugin_function('set_version', version)

        return version
556473
public function repoList($repo, $path = null, $ref = null)
    {
        $src = $this->client->api('Repositories\Src');
        /** @var \Buzz\Message\Response $response */
        $response = $this->checkResponse($src->get($this->username, $repo, $ref, $path));

        return $this->cleanSrcList(json_decode($response->getContent(), true));
    }
239407
public function loadExtraInfos(Repo $repo)
    {
        try {
            $this->scrutinizerLoader->load($repo);
            $this->travisLoader->load($repo);
            $this->versionEyeLoader->load($repo);

        } catch (\Exception $e) {
            print_r($e->getMessage());
            // We do not want to throw exception here!
            // Travis or Scrutinizer may not be configured
        }
    }
1097562
public function add_setting_field( $fields, $repo ) {
		if ( ! empty( $fields ) ) {
			return $fields;
		}

		return $this->get_repo_api( $repo->git, $repo )->add_repo_setting_field();
	}
100109
public function get($account, $repo)
    {
        return $this->getClient()->setApiVersion('2.0')->get(
            sprintf('repositories/%s/%s', $account, $repo)
        );
    }
928741
public function getStableBadge(Repo $repo)
    {
        if ($repo->getPackagistSlug()) {
            return sprintf('<img src="%s" />', $this->helper->getStableVersionBadgeUrl($repo->getPackagistSlug()));
        }

        return '';
    }
640446
protected function modifyContentTypeRecord(Repository $repo, Content $entity, $action, $fieldData)
    {
        if ($action === 'delete') {
            return $this->deleteRecord($repo, $entity);
        }
        if ($action === 'modify' && $fieldData !== null) {
            $this->modifyRecord($entity, $fieldData);

            if ($entity->_modified === true) {
                return $repo->save($entity);
            }
        }
    }
158974
public function get_remote_repo_meta( $repo ) {
		$file = 'style.css';
		if ( false !== stripos( $repo->type, 'plugin' ) ) {
			$file = basename( $repo->file );
		}

		$repo_api = Singleton::get_instance( 'API', $this )->get_repo_api( $repo->git, $repo );
		if ( null === $repo_api ) {
			return false;
		}

		$this->{$repo->type} = $repo;
		$this->set_defaults( $repo->type );

		if ( $repo_api->get_remote_info( $file ) ) {
			if ( ! self::is_wp_cli() ) {
				if ( ! apply_filters( 'github_updater_run_at_scale', false ) ) {
					$repo_api->get_repo_meta();
					$changelog = $this->get_changelog_filename( $repo );
					if ( $changelog ) {
						$repo_api->get_remote_changes( $changelog );
					}
					$repo_api->get_remote_readme();
				}
				if ( ! empty( self::$options['branch_switch'] ) ) {
					$repo_api->get_remote_branches();
				}
			}
			$repo_api->get_remote_tag();
			$repo->download_link = $repo_api->construct_download_link();
			$language_pack       = new Language_Pack( $repo, new Language_Pack_API( $repo ) );
			$language_pack->run();
		}

		$this->remove_hooks( $repo_api );

		return true;
	}
104798
public function get($user, $repo, $name)
	{
		// Build the request path.
		$path = '/repos/' . $user . '/' . $repo . '/labels/' . $name;

		// Send the request.
		return $this->processResponse(
			$response = $this->client->get($this->fetchUrl($path))
		);
	}
1048127
public function add($owner, $repo, $user)
	{
		// Build the request path.
		$path = '/repos/' . $owner . '/' . $repo . '/collaborators/' . $user;

		return $this->processResponse(
			$this->client->put($this->fetchUrl($path), ''),
			204
		);
	}
398684
protected function validatePackageRepositories($index, $repo)
    {
        if ('package' !== $repo['type']) {
            return;
        }

        if (!isset($repo['package'])) {
            throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a package definition"');
        }

        foreach (array('name', 'type', 'version', 'dist') as $key) {
            if (!isset($repo['package'][$key])) {
                throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have the "'.$key.'" key  in the package definition"');
            }
        }
    }
886503
public function getFile(Repo $repo)
    {
        $file = tempnam(sys_get_temp_dir(), 'composer');
        $content = file_get_contents($this->helper->getRawFileUrl($repo->getSlug(), 'master', 'composer.json'));
        file_put_contents($file, $content);

        return $file;
    }
535171
public function load(Repo $repo)
    {
        $project = $this->client->createProject($this->composerLoader->getFile($repo));

        $repo->setDependencies($project->getDependencies());

        return $repo;
    }
1155232
public function update(Repository $repository = null)
    {
        if (!$repository) {
            $repository = $this->getRepository();
        }

        $repository = $repository->aliased('write');

        $update = $this->getQuery()->transformToUpdate();

        $update->setSet($this->setData);

        $prepare = $repository->prepareQuery($update);

        return $repository->executePrepared($prepare);
    }