MCPcopy Create free account
hub / github.com/angular/dev-infra / getRepositoryGitUrl

Function getRepositoryGitUrl

ng-dev/utils/git/github-urls.ts:29–41  ·  view source on GitHub ↗
(
  config: Pick<GithubConfig, 'name' | 'owner' | 'useSsh'>,
  githubToken?: string,
)

Source from the content-addressed store, hash-verified

27
28/** Gets the repository Git URL for the given github config. */
29export function getRepositoryGitUrl(
30 config: Pick<GithubConfig, 'name' | 'owner' | 'useSsh'>,
31 githubToken?: string,
32): string {
33 if (config.useSsh) {
34 return `git@github.com:${config.owner}/${config.name}.git`;
35 }
36 const baseHttpUrl = `https://github.com/${config.owner}/${config.name}.git`;
37 if (githubToken !== undefined) {
38 return addTokenToGitHttpsUrl(baseHttpUrl, githubToken);
39 }
40 return baseHttpUrl;
41}
42
43/** Gets a Github URL that refers to a list of recent commits within a specified branch. */
44export function getListCommitsInBranchUrl(client: GitClient, branchName: string) {

Callers 3

getRepoGitUrlMethod · 0.85
getRepoGitUrlMethod · 0.85
_pushHeadToForkFunction · 0.85

Calls 1

addTokenToGitHttpsUrlFunction · 0.85

Tested by

no test coverage detected