MCPcopy Index your code
hub / github.com/anomalyco/opencode / parseGitHubRemote

Function parseGitHubRemote

packages/opencode/src/util/repository.ts:213–220  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

211}
212
213export function parseGitHubRemote(input: string) {
214 const cleaned = normalizeRepositoryInput(input)
215 if (!cleaned.includes("://") && !cleaned.match(/^(?:[^@/\s]+@)?github\.com:/)) return null
216
217 const parsed = parseRepositoryReference(cleaned)
218 if (!parsed || parsed.host !== "github.com" || !parsed.owner || parsed.segments.length !== 2) return null
219 return { owner: parsed.owner, repo: parsed.repo }
220}
221
222export function repositoryCachePath(input: Reference) {
223 return path.join(Global.Path.repos, ...input.host.split(":"), ...input.segments)

Callers 2

getAppInfoFunction · 0.90

Calls 2

normalizeRepositoryInputFunction · 0.85
parseRepositoryReferenceFunction · 0.85

Tested by

no test coverage detected