(cwd: string)
| 28 | } |
| 29 | |
| 30 | async function findRepositoryRoot(cwd: string): Promise<string | null> { |
| 31 | try { |
| 32 | return (await git(cwd, ["rev-parse", "--show-toplevel"])).trim() || null; |
| 33 | } catch { |
| 34 | return null; |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | function isWithinPath(parent: string, target: string): boolean { |
| 39 | const relative = path.relative(path.resolve(parent), path.resolve(target)); |
no test coverage detected