lib/git.js
async function isGitRepo(execaOpts) {
  try {
    return (await execa('git', ['rev-parse', '--git-dir'], execaOpts)).code === 0;
  } catch (error) {
    debug(error);
  }
}
async function isGitRepo(execaOpts) {
  try {
    return (await execa('git', ['rev-parse', '--git-dir'], execaOpts)).code === 0;
  } catch (error) {
    debug(error);
  }
}
async function isGitRepo ( execaOpts ) { try { return ( await execa ( 'git' , [ 'rev-parse' , '--git-dir' ] , execaOpts ) ) . code === 0 ; } catch ( error ) { debug ( error ) ; } }
Test if the current working directory is a Git repository.

@param {Object} [execaOpts] Options to pass to `execa`.

@return {Boolean} `true` if the current working directory is in a git repository, falsy otherwise.
Test if the current working directory is a Git repository .