MCPcopy Create free account
hub / github.com/VPSDance/ai-proxy-rules / listFilesAtRef

Function listFilesAtRef

scripts/diff-summary.ts:68–81  ·  view source on GitHub ↗
(ref: string, dir: string)

Source from the content-addressed store, hash-verified

66}
67
68async function listFilesAtRef(ref: string, dir: string): Promise<Set<string>> {
69 const norm = dir.replace(/\\/g, "/");
70 try {
71 const { stdout } = await exec("git", ["ls-tree", "--name-only", `${ref}:${norm}`], { maxBuffer: 1 * 1024 * 1024 });
72 return new Set(
73 stdout
74 .split(/\r?\n/)
75 .map((line) => line.trim())
76 .filter((line) => /\.ya?ml$/i.test(line))
77 );
78 } catch {
79 return new Set();
80 }
81}
82
83async function getFileAtRef(ref: string, relPath: string): Promise<string | null> {
84 try {

Callers 1

diffSummaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected