MCPcopy Create free account
hub / github.com/anomalyco/opencode / parseRemote

Function parseRemote

packages/core/src/repository.ts:88–103  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

86}
87
88export function parseRemote(input: string): RemoteReference {
89 const reference = parse(input)
90 if (!reference) {
91 throw new InvalidReferenceError({
92 repository: input,
93 message: "Repository must be a git URL, host/path reference, or GitHub owner/repo shorthand",
94 })
95 }
96 if (!isRemote(reference)) {
97 throw new UnsupportedLocalRepositoryError({
98 repository: input,
99 message: "Local file repositories are not supported",
100 })
101 }
102 return reference
103}
104
105export function validateBranch(branch: string): void {
106 if (/^[A-Za-z0-9/_.-]+$/.test(branch) && !branch.startsWith("-") && !branch.includes("..")) return

Callers

nothing calls this directly

Calls 2

isRemoteFunction · 0.85
parseFunction · 0.70

Tested by

no test coverage detected