lib/git.js
async function isRefInHistory(ref, execaOpts) {
  try {
    await execa('git', ['merge-base', '--is-ancestor', ref, 'HEAD'], execaOpts);
    return true;
  } catch (error) {
    if (error.code === 1) {
      return false;
    }

    debug(error);
    throw error;
  }
}
async function isRefInHistory(ref, execaOpts) {
  try {
    await execa('git', ['merge-base', '--is-ancestor', ref, 'HEAD'], execaOpts);
    return true;
  } catch (error) {
    if (error.code === 1) {
      return false;
    }

    debug(error);
    throw error;
  }
}
async function isRefInHistory ( ref , execaOpts ) { try { await execa ( 'git' , [ 'merge-base' , '--is-ancestor' , ref , 'HEAD' ] , execaOpts ) ; return true ; } catch ( error ) { if ( error . code === 1 ) { return false ; } debug ( error ) ; throw error ; } }
Verify if the `ref` is in the direct history of the current branch.

@param {String} ref The reference to look for.
@param {Object} [execaOpts] Options to pass to `execa`.

@return {Boolean} `true` if the reference is in the history of the current branch, falsy otherwise.
Verify if the ref is in the direct history of the current branch .