async function fetchNotes(repositoryUrl, execaOptions) {
  try {
    await execa("git", ["fetch", "--unshallow", repositoryUrl, `+refs/notes/*:refs/notes/*`], execaOptions);
  } catch {
    await execa("git", ["fetch", repositoryUrl, `+refs/notes/*:refs/notes/*`], {
      ...execaOptions,
      reject: false,
    });
  }
}
Unshallow the git repository if necessary and fetch all the notes.

@param {String} repositoryUrl The remote repository URL.
@param {Object} [execaOpts] Options to pass to `execa`.