(gitDir: string)
| 273 | * Returns null if no commondir file exists (regular repo). |
| 274 | */ |
| 275 | export async function getCommonDir(gitDir: string): Promise<string | null> { |
| 276 | try { |
| 277 | const content = (await readFile(join(gitDir, 'commondir'), 'utf-8')).trim() |
| 278 | return resolve(gitDir, content) |
| 279 | } catch { |
| 280 | return null |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | /** |
| 285 | * Read a raw symref file and extract the branch name after a known prefix. |
no test coverage detected