MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / getRepoTree

Function getRepoTree

Support/SingleFileLibs/javascript/app.js:194–205  ·  view source on GitHub ↗
(ref)

Source from the content-addressed store, hash-verified

192 }
193
194 async function getRepoTree(ref) {
195 // Use trees API for a single call listing all files
196 // Resolve ref to SHA first
197 const sha = await getCommitShaForRef(ref);
198 const cached = state.repoTreeByRef.get(ref);
199 if (cached && cached.sha === sha) return cached;
200 const data = await fetchJSON(`https://api.github.com/repos/${OWNER}/${REPO}/git/trees/${sha}?recursive=1`);
201 const tree = Array.isArray(data.tree) ? data.tree : [];
202 const obj = { sha, tree };
203 state.repoTreeByRef.set(ref, obj);
204 return obj;
205 }
206
207 // Local resources
208 async function loadDependenciesJson() {

Callers 2

renderTableRowsFunction · 0.85
downloadAllZipFunction · 0.85

Calls 4

getCommitShaForRefFunction · 0.85
fetchJSONFunction · 0.85
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected