| 66 | } |
| 67 | |
| 68 | async 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 | |
| 83 | async function getFileAtRef(ref: string, relPath: string): Promise<string | null> { |
| 84 | try { |