Ensure the remote exist for the org and repo.

@param string $org
@param string $repo
188021
public function ensureRemoteExists($org, $repo)
    {
        $adapter = $this->application->getAdapter();
        $pushUrl = $adapter->getRepositoryInfo($org, $repo)['push_url'];

        if (!$this->remoteExists($org, $pushUrl)) {
            $this->getHelperSet()->get('gush_style')->note(
                sprintf('Adding remote "%s" with "%s".', $org, $pushUrl)
            );

            $this->setRemote($org, $pushUrl, $pushUrl);
        }
    }
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;
    }
75109
private function getClass($repo)
    {
        $class = S::create(
            str_replace(['.'], ['-'], basename($repo, '.git'))
        )->camelize();

        return ucfirst(trim($class));
    }
1272690
public function getUrl(Repo $repo)
    {
        return $this->helper->getUrl(
            $repo->getSlug(),
            $repo->getType()
        );
    }
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
        }
    }
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()
        );
    }
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))
		);
	}
375885
private function resolvePull($user, $repo, $reference)
    {
        if (!$pull = $this->parseRefAsPull($reference)) {
            return null;
        }

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

        $data = $this->callGitHub([$api, 'show'], $params);
        return $data['head']['sha'] ?? null;
    }
265040
public function loadPackagistInfos(Repo $repo)
    {
        try {
            $this->composerReader->load($repo->getSlug());

            // Load package name
            if ($this->composerReader->has('name')) {
                $repo->setPackagistSlug($this->composerReader->get('name'));
            }

            // Load authors
            if ($this->composerReader->has('authors')) {
                $repo->setAuthors($this->composerReader->get('authors'));
            }

            // Load dependencies
            if ($this->composerReader->has('require')) {
                $repo->setDependencies($this->composerReader->get('require'));
            }
        } catch (\Exception $e) {
            // We do not want to throw exception here!
        }
    }
1174354
public function tag(string $name, string $repo, string $tag = 'latest')
    {
        $data = [
            'repo' => $repo,
            'tag' => $tag,
        ];

        $url = self::$base_url.'/'.$name.'/tag?'.http_build_query($data);

        return self::$curl->post($url);
    }
698208
public function validate($repo, Constraint $constraint)
    {
        if($this->repoManager->isExists($repo)) {
            $this->context->addViolation($constraint->message, array('string' => $repo->getSlug()));
        }
    }
1184833
protected function parse_header_uri( $repo_header ) {
		$header_parts         = parse_url( $repo_header );
		$header_path          = pathinfo( $header_parts['path'] );
		$header['original']   = $repo_header;
		$header['scheme']     = isset( $header_parts['scheme'] ) ? $header_parts['scheme'] : null;
		$header['host']       = isset( $header_parts['host'] ) ? $header_parts['host'] : null;
		$header['owner']      = trim( $header_path['dirname'], '/' );
		$header['repo']       = $header_path['filename'];
		$header['owner_repo'] = implode( '/', [ $header['owner'], $header['repo'] ] );
		$header['base_uri']   = str_replace( $header_parts['path'], '', $repo_header );
		$header['uri']        = isset( $header['scheme'] ) ? trim( $repo_header, '/' ) : null;

		$header = $this->sanitize( $header );

		return $header;
	}
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));
    }
730251
public function create(Repo $repo)
    {
        $rows = $this->getRows();
        $id = sizeof($rows) + 1;

        $rows[] = array(
            'id' => $id,
            'slug' => $repo->getSlug(),
            'type' => $repo->getType(),
            'qualityBadgeHash' => $repo->getQualityBadgeHash(),
            'coverageBadgeHash' => $repo->getCoverageBadgeHash(),
        );

        file_put_contents($this->filename, Yaml::dump($rows));
    }
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 );
	}
315386
public function get_remote_api_repo_meta( $git, $request ) {
		$response = isset( $this->response['meta'] ) ? $this->response['meta'] : false;

		if ( ! $response ) {
			self::$method = 'meta';
			$response     = $this->api( $request );

			if ( $response ) {
				$response = $this->parse_meta_response( $response );
				$this->set_repo_cache( 'meta', $response );
			}
		}

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

		$this->type->repo_meta = $response;
		$this->add_meta_repo_object();

		return true;
	}
928237
def remove_repo(self, repo):
        
        url = self._build_url('repos', repo, base_url=self._api)
        return self._boolean(self._delete(url), 204, 404)