()
| 277 | } |
| 278 | |
| 279 | function mainCheckoutRoot() { |
| 280 | const result = spawnSync( |
| 281 | "git", |
| 282 | ["rev-parse", "--path-format=absolute", "--git-common-dir"], |
| 283 | { cwd: ROOT, encoding: "utf8" }, |
| 284 | ); |
| 285 | if (result.status !== 0) { |
| 286 | return null; |
| 287 | } |
| 288 | |
| 289 | const gitCommonDir = result.stdout.trim(); |
| 290 | if (basename(gitCommonDir) !== ".git") { |
| 291 | return null; |
| 292 | } |
| 293 | return dirname(gitCommonDir); |
| 294 | } |
| 295 | |
| 296 | function hashFiles(paths) { |
| 297 | const hash = createHash("sha256"); |