Function
isInsideExistingWorkTree
(gitBin: string, cwd: string)
Source from the content-addressed store, hash-verified
| 29 | } |
| 30 | |
| 31 | async function isInsideExistingWorkTree(gitBin: string, cwd: string): Promise<boolean> { |
| 32 | try { |
| 33 | const { stdout } = await execFileAsync(gitBin, ['rev-parse', '--is-inside-work-tree'], { |
| 34 | cwd, |
| 35 | }); |
| 36 | return stdout.trim() === 'true'; |
| 37 | } catch { |
| 38 | return false; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | export async function ensureProjectGit(projectRoot: string): Promise<EnsureProjectGitResult> { |
| 43 | const abs = resolve(projectRoot); |
Tested by
no test coverage detected