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

Function constructRepositoryUrl

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

Source from the content-addressed store, hash-verified

253 * constructRepositoryUrl("bitbucket", "owner/repo") // "https://bitbucket.org/owner/repo"
254 */
255export const constructRepositoryUrl = (
256 provider: Provider,
257 repositoryName: string,
258 host?: string | null,
259): string => {
260 const baseUrl = ensureHttpsPrefix(host);
261 if (provider === "bitbucket_data_center") {
262 const [project, repo] = repositoryName.split("/");
263 return `${baseUrl}/projects/${project}/repos/${repo}`;
264 }
265 return `${baseUrl}/${repositoryName}`;
266};
267
268/**
269 * Construct the branch URL for different providers

Callers 1

GitControlBarRepoButtonFunction · 0.90

Calls 1

ensureHttpsPrefixFunction · 0.85

Tested by

no test coverage detected