MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / constructRepositoryUrl

Function constructRepositoryUrl

src/utils/utils.ts:391–402  ·  view source on GitHub ↗
(
  provider: Provider,
  repositoryName: string,
  host?: string | null,
)

Source from the content-addressed store, hash-verified

389 * constructRepositoryUrl("bitbucket", "owner/repo") // "https://bitbucket.org/owner/repo"
390 */
391export const constructRepositoryUrl = (
392 provider: Provider,
393 repositoryName: string,
394 host?: string | null,
395): string => {
396 const baseUrl = getGitProviderBaseUrl(provider, host);
397 if (provider === "bitbucket_data_center") {
398 const [project, repo] = repositoryName.split("/");
399 return `${baseUrl}/projects/${project}/repos/${repo}`;
400 }
401 return `${baseUrl}/${repositoryName}`;
402};
403
404/**
405 * Construct the branch URL for different providers

Callers 1

GitControlBarRepoButtonFunction · 0.90

Calls 1

getGitProviderBaseUrlFunction · 0.85

Tested by

no test coverage detected