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