(repoRoot: string)
| 39 | } |
| 40 | |
| 41 | function readOriginUrl(repoRoot: string): string | null { |
| 42 | try { |
| 43 | const out = execFileSync("git", ["-C", repoRoot, "remote", "get-url", "origin"], { |
| 44 | encoding: "utf8", |
| 45 | stdio: ["ignore", "pipe", "ignore"], |
| 46 | }).trim(); |
| 47 | return out || null; |
| 48 | } catch { |
| 49 | return null; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /** Configured `user.name` for the repo, or null when unset. Used as a viewer-identity fallback. */ |
| 54 | export function readGitUserName(repoRoot: string): string | null { |