(projectPath: string)
| 48 | } |
| 49 | |
| 50 | export async function listLocalBranches(projectPath: string): Promise<string[]> { |
| 51 | using proc = execFileAsync("git", [ |
| 52 | "-C", |
| 53 | projectPath, |
| 54 | "for-each-ref", |
| 55 | "--format=%(refname:short)", |
| 56 | "refs/heads", |
| 57 | ]); |
| 58 | const { stdout } = await proc.result; |
| 59 | return stdout |
| 60 | .split("\n") |
| 61 | .map((line) => line.trim()) |
| 62 | .filter((line) => line.length > 0) |
| 63 | .sort((a, b) => a.localeCompare(b)); |
| 64 | } |
| 65 | |
| 66 | export async function getCurrentBranch(projectPath: string): Promise<string | null> { |
| 67 | try { |
no test coverage detected