* Gets the content of a file at a given git ref. * Returns null if the file doesn't exist at that ref.
(projectCwd: string, gitRef: string, relPath: string)
| 75 | * Returns null if the file doesn't exist at that ref. |
| 76 | */ |
| 77 | function getFileAtRef(projectCwd: string, gitRef: string, relPath: string): string | null { |
| 78 | try { |
| 79 | return execSync(`git show ${gitRef}:${relPath}`, { |
| 80 | cwd: projectCwd, |
| 81 | stdio: ['pipe', 'pipe', 'pipe'], |
| 82 | maxBuffer: 10 * 1024 * 1024, // 10MB |
| 83 | }).toString(); |
| 84 | } catch { |
| 85 | return null; // File didn't exist at that ref |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Discovers files that changed since the session baseline by combining |
no outgoing calls
no test coverage detected