MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / cleanRepoPathSegment

Function cleanRepoPathSegment

website/src/lib/repo-provider.ts:20–27  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

18
19/** Strip trailing .git, /-/* UI paths, and query/hash from a repo path segment. */
20export function cleanRepoPathSegment(path: string): string {
21 return path
22 .replace(/\.git$/, "")
23 .replace(/\/-$/, "")
24 .replace(/\/-\/.*$/, "")
25 .replace(/[?#].*$/, "")
26 .replace(/\/$/, "");
27}
28
29/** Parse a user-supplied URL or `owner/repo` shorthand into a RepoRef. */
30export function parseRepoInput(input: string): RepoRef | null {

Callers 2

parseRepoInputFunction · 0.85
repoRefFromRouteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected