MCPcopy Index your code
hub / github.com/upstash/context7 / fetchRepoTree

Function fetchRepoTree

packages/cli/src/utils/github.ts:164–174  ·  view source on GitHub ↗
(
  owner: string,
  repo: string,
  branch: string,
  headers: Record<string, string>
)

Source from the content-addressed store, hash-verified

162}
163
164async function fetchRepoTree(
165 owner: string,
166 repo: string,
167 branch: string,
168 headers: Record<string, string>
169): Promise<GitHubTreeResponse | { error: string }> {
170 const treeUrl = `${GITHUB_API}/repos/${owner}/${repo}/git/trees/${branch}?recursive=1`;
171 const response = await fetch(treeUrl, { headers });
172 if (!response.ok) return { error: await extractGitHubError(response) };
173 return (await response.json()) as GitHubTreeResponse;
174}
175
176async function fetchDefaultBranch(
177 owner: string,

Callers 2

listSkillsFromGitHubFunction · 0.85
downloadSkillFromGitHubFunction · 0.85

Calls 1

extractGitHubErrorFunction · 0.85

Tested by

no test coverage detected