()
| 502 | } |
| 503 | |
| 504 | export async function getGithubRepo(): Promise<string | null> { |
| 505 | const { parseGitRemote } = await import('./detectRepository.js') |
| 506 | const remoteUrl = await getRemoteUrl() |
| 507 | if (!remoteUrl) { |
| 508 | logForDebugging('Local GitHub repo: unknown') |
| 509 | return null |
| 510 | } |
| 511 | // Only return results for github.com — callers (e.g. issue submission) |
| 512 | // assume the result is a github.com repository. |
| 513 | const parsed = parseGitRemote(remoteUrl) |
| 514 | if (parsed && parsed.host === 'github.com') { |
| 515 | const result = `${parsed.owner}/${parsed.name}` |
| 516 | logForDebugging(`Local GitHub repo: ${result}`) |
| 517 | return result |
| 518 | } |
| 519 | logForDebugging('Local GitHub repo: unknown') |
| 520 | return null |
| 521 | } |
| 522 | |
| 523 | /** |
| 524 | * Preserved git state for issue submission. |
no test coverage detected