Update an repo

@param Repo $repo
@return mixex
518970
public function update(Repo $repo)
    {
        $repo = $this->_em->merge($repo);
        $this->_em->persist($repo);
        $this->_em->flush($repo);

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

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

        return $repo;
    }
1253168
func (o *Opts) Repo(repo string) *Opts {
	o.repo = repo
	return o
}
512889
def git_update(repo, options = {})
      ensure_ready!(:authorization)
      response = connection.patch(git_repo_path(repo), options)
      checked_response_body(response)
    end
589572
public function urlForRepository(string $user, string $repo): string
    {
        $key = sprintf(self::CACHE_KEY_TEMPLATE, md5($user . $repo), 'repo_url');

        if (($latest = $this->getFromCache($key)) !== null) {
            return $latest;
        }

        $api = $this->client->api('repo');
        $params = [$user, $repo];

        $repo = $this->callGitHub([$api, 'show'], $params);

        $url = $repo['html_url'] ?? '';

        $this->setToCache($key, $url, 30);
        return $url;
    }
564315
protected function get_repo_parts( $repo, $type ) {
		$arr['bool']    = false;
		$pattern        = '/' . strtolower( $repo ) . '_/';
		$type           = preg_replace( $pattern, '', $type );
		$repo_types     = [
			'GitHub'    => 'github_' . $type,
			'Bitbucket' => 'bitbucket_' . $type,
			'GitLab'    => 'gitlab_' . $type,
			'Gitea'     => 'gitea_' . $type,
		];
		$repo_base_uris = [
			'GitHub'    => 'https://github.com/',
			'Bitbucket' => 'https://bitbucket.org/',
			'GitLab'    => 'https://gitlab.com/',
			'Gitea'     => '',
		];

		if ( array_key_exists( $repo, $repo_types ) ) {
			$arr['type']       = $repo_types[ $repo ];
			$arr['git_server'] = strtolower( $repo );
			$arr['base_uri']   = $repo_base_uris[ $repo ];
			$arr['bool']       = true;
			foreach ( self::$extra_repo_headers as $key => $value ) {
				$arr[ $key ] = $repo . ' ' . $value;
			}
		}

		return $arr;
	}
1125559
public function install(
        InstalledRepositoryInterface $repo,
        PackageInterface $package
    ) {
        $installPath = $this->getInstallPath($package);
        $junglist = new FileJunglist;
        DebugPrinter::log(
            'Installing package `%s` to %s',
            array($package->getPrettyName(), $installPath,)
        );
        parent::install($repo, $package);
        DebugPrinter::log('Post-install file rotating');
        $junglist->rotateInstalledFiles($installPath);
        $junglist->copyConfigFiles($installPath);
        DebugPrinter::log('Finished installation');
    }
548548
public function editAction(Repo $repo = null)
    {
        if (!$repo) {
            return new RedirectResponse($this->generateUrl('snide_travinizer_dashboard'));
        }
        $form = $this->getForm($repo);
        return array(
            'form' => $form->createView(),
            'repo' => $repo,
            'slug' => $repo->getSlug(),
            'errors' => array()
        );
    }
1097009
protected function waiting_for_background_update( $repo = null ) {
		$caches = [];
		if ( null !== $repo ) {
			$cache = isset( $repo->slug ) ? $this->get_repo_cache( $repo->slug ) : null;

			return empty( $cache );
		}
		$repos = array_merge(
			Singleton::get_instance( 'Plugin', $this )->get_plugin_configs(),
			Singleton::get_instance( 'Theme', $this )->get_theme_configs()
		);
		foreach ( $repos as $git_repo ) {
			$caches[ $git_repo->slug ] = $this->get_repo_cache( $git_repo->slug );
		}
		$waiting = array_filter(
			$caches,
			function ( $e ) {
				return empty( $e );
			}
		);

		return ! empty( $waiting );
	}
1370129
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        new Textpattern();
        parent::install($repo, $package);
        $plugin = new $this->textpatternPackager($this->getInstallPath($package), $package);
        $plugin->install();
    }
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);
            }
        }
    }
1004677
public function createRepo(string $repo = null)
    {
        $end = $this->getVendorType() === 'org'
            ?'/orgs/' . $this->getVendor() . '/repos'
            : '/user/repos'
        ;
        $res = $this->request('POST', $end, [
            'name'        => $this->getName(),
            'description' => $this->getDescription(),
        ]);
        if (Helper::isResponseOk($res)) {
            echo "\ngit remote add origin git@github.com:{$this->getFullName()}.git\n";
            echo "git push -u origin master\n";
        }

        return $res;
    }
257366
protected function validateVcsRepositories($index, $repo)
    {
        if ('package' === $repo['type']) {
            return;
        }

        if (false === strpos($repo['type'], '-')) {
            throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a type defined in this way: "%asset-type%-%type%"');
        }
        if (!isset($repo['url'])) {
            throw new \UnexpectedValueException('Repository '.$index.' ('.json_encode($repo).') must have a url defined');
        }
    }
336168
public function repository(string $user, string $repo): ?array
    {
        $api = $this->client->api('repo');
        $params = [$user, $repo];

        $repo = $this->callGitHub([$api, 'show'], $params);

        return is_array($repo) ? $repo : null;
    }
1220374
protected function deleteRecord(Repository $repo, Content $entity)
    {
        $recordId = $entity->getId();
        /** @var Mapping\ContentType $contentType */
        $contentType = $entity->getContenttype();
        $contentTypeName = (string) $contentType;
        if (!$this->users->isAllowed("contenttype:$contentTypeName:delete:$recordId")) {
            $this->loggerFlash->error(Trans::__('general.access-denied.content-not-modified', ['%title%' => $entity->getTitle()]));

            return false;
        }
        $result = $repo->delete($entity);
        if ($result) {
            $this->loggerSystem->info(sprintf('Deleted %s: %s', $contentType['singular_name'], $entity->getTitle()), ['event' => 'content']);
            $fieldRepo = $this->em->getRepository(FieldValue::class);
            $deleteFieldQuery = $fieldRepo->createQueryBuilder()
                ->delete($fieldRepo->getTableName())
                ->where('content_id = :content_id')
                ->andWhere('contenttype= :contenttype')
                ->setParameter('content_id', $recordId)
                ->setParameter('contenttype', $contentTypeName);
            $deleteFieldQuery->execute();
        }

        return $result;
    }
100109
public function get($account, $repo)
    {
        return $this->getClient()->setApiVersion('2.0')->get(
            sprintf('repositories/%s/%s', $account, $repo)
        );
    }
75109
private function getClass($repo)
    {
        $class = S::create(
            str_replace(['.'], ['-'], basename($repo, '.git'))
        )->camelize();

        return ucfirst(trim($class));
    }