()
| 517 | } |
| 518 | |
| 519 | export async function getGithubRepo(): Promise<string | null> { |
| 520 | const { parseGitRemote } = await import('./detectRepository.js') |
| 521 | const remoteUrl = await getRemoteUrl() |
| 522 | if (!remoteUrl) { |
| 523 | logForDebugging('Local GitHub repo: unknown') |
| 524 | return null |
| 525 | } |
| 526 | // Only return results for github.com — callers (e.g. issue submission) |
| 527 | // assume the result is a github.com repository. |
| 528 | const parsed = parseGitRemote(remoteUrl) |
| 529 | if (parsed && parsed.host === 'github.com') { |
| 530 | const result = `${parsed.owner}/${parsed.name}` |
| 531 | logForDebugging(`Local GitHub repo: ${result}`) |
| 532 | return result |
| 533 | } |
| 534 | logForDebugging('Local GitHub repo: unknown') |
| 535 | return null |
| 536 | } |
| 537 | |
| 538 | /** |
| 539 | * Preserved git state for issue submission. |
no test coverage detected