async function getNote(ref, execaOptions) {
  const handleError = (error) => {
    if (error.exitCode === 1) {
      return { stdout: "{}" };
    }

    debug(error);
    throw error;
  };

  try {
    return merge(
      JSON.parse(
        // Used for retro-compatibility
        (await execa("git", ["notes", "--ref", GIT_NOTE_REF, "show", ref], execaOptions).catch(handleError)).stdout
      ),
      JSON.parse(
        (await execa("git", ["notes", "--ref", `${GIT_NOTE_REF}-${ref}`, "show", ref], execaOptions).catch(handleError))
          .stdout
      )
    );
  } catch (error) {
    if (error.exitCode === 1) {
      return {};
    }

    debug(error);
    throw error;
  }
}
Get and parse the JSON note of a given reference.

@param {String} ref The Git reference for which to retrieve the note.
@param {Object} [execaOpts] Options to pass to `execa`.

@return {Object} the parsed JSON note if there is one, an empty object otherwise.