()
| 512 | } |
| 513 | |
| 514 | async function computeHead(): Promise<string> { |
| 515 | const gitDir = await resolveGitDir() |
| 516 | if (!gitDir) { |
| 517 | return '' |
| 518 | } |
| 519 | const head = await readGitHead(gitDir) |
| 520 | if (!head) { |
| 521 | return '' |
| 522 | } |
| 523 | if (head.type === 'branch') { |
| 524 | return (await resolveRef(gitDir, `refs/heads/${head.name}`)) ?? '' |
| 525 | } |
| 526 | return head.sha |
| 527 | } |
| 528 | |
| 529 | async function computeRemoteUrl(): Promise<string | null> { |
| 530 | const gitDir = await resolveGitDir() |
nothing calls this directly
no test coverage detected