MCPcopy Index your code
hub / github.com/github/github-mcp-server / parseRepositoryURL

Function parseRepositoryURL

pkg/github/issues.go:1657–1671  ·  view source on GitHub ↗

parseRepositoryURL extracts the owner and repo from a GitHub API repository URL of the form https://api.github.com/repos/{owner}/{repo}.

(repoURL string)

Source from the content-addressed store, hash-verified

1655// parseRepositoryURL extracts the owner and repo from a GitHub API repository
1656// URL of the form https://api.github.com/repos/{owner}/{repo}.
1657func parseRepositoryURL(repoURL string) (string, string, bool) {
1658 if repoURL == "" {
1659 return "", "", false
1660 }
1661 const marker = "/repos/"
1662 idx := strings.LastIndex(repoURL, marker)
1663 if idx < 0 {
1664 return "", "", false
1665 }
1666 parts := strings.Split(strings.Trim(repoURL[idx+len(marker):], "/"), "/")
1667 if len(parts) < 2 || parts[0] == "" || parts[1] == "" {
1668 return "", "", false
1669 }
1670 return parts[0], parts[1], true
1671}
1672
1673// SearchIssueResult wraps a REST search hit with its custom issue field values, fetched in a follow-up GraphQL nodes() query.
1674type SearchIssueResult struct {

Callers 1

uniqueSearchIssuesReposFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected