()
| 90 | } |
| 91 | |
| 92 | private get shadowGitRepository(): SimpleGit { |
| 93 | const repoDir = this.getHistoryDir(); |
| 94 | return simpleGit(this.projectRoot).env({ |
| 95 | GIT_DIR: path.join(repoDir, '.git'), |
| 96 | GIT_WORK_TREE: this.projectRoot, |
| 97 | // Prevent git from using the user's global git config. |
| 98 | HOME: repoDir, |
| 99 | XDG_CONFIG_HOME: repoDir, |
| 100 | }); |
| 101 | } |
| 102 | |
| 103 | async getCurrentCommitHash(): Promise<string> { |
| 104 | const hash = await this.shadowGitRepository.raw('rev-parse', 'HEAD'); |
nothing calls this directly
no test coverage detected