* The key a block records for its project: the resolved root with forward * slashes, which Git for Windows' sh also accepts.
(projectRoot: string)
| 91 | * slashes, which Git for Windows' sh also accepts. |
| 92 | */ |
| 93 | function rootKey(projectRoot: string): string { |
| 94 | let resolved = path.resolve(projectRoot); |
| 95 | try { |
| 96 | resolved = fs.realpathSync(resolved); |
| 97 | } catch { |
| 98 | /* keep the lexical path when it can't be resolved */ |
| 99 | } |
| 100 | return resolved.split(path.sep).join('/'); |
| 101 | } |
| 102 | |
| 103 | /** The work tree's top level (as a {@link rootKey}), or null when unknown. */ |
| 104 | function gitToplevelKey(projectRoot: string): string | null { |
no test coverage detected