static _getCommitHash(projectPath) {
    let commitHash;
    let isGitRepo;
    try {
      isGitRepo = fsAdapter.fs.lstatSync(path.resolve(projectPath, '.git')).isDirectory();
      // eslint-disable-next-line no-empty
    } catch (_) {}

    if (isGitRepo) {
      try {
        // eslint-disable-next-line camelcase
        const hash = child_process
          .execSync('git rev-parse HEAD', {
            cwd: projectPath,
          })
          .toString('utf-8')
          .slice(0, -1);
        // eslint-disable-next-line no-param-reassign
        commitHash = hash;
      } catch (e) {
        LogService.warn(/** @type {string} */ (e));
      }
    } else {
      commitHash = '[not-a-git-root]';
    }
    return commitHash;
  }
@param {PathFromSystemRoot} projectPath
@returns {string|'[not-a-git-root]'|undefined}