code: async function archiveGitTree(repPath, tree, archive) {
    // recursively collect all entries (blobs and trees)
    const allEntries = await collectTreeEntries(repPath, tree, [], '');
  
    const process = async ({ type, oid, path }) => {
      if (type === 'tree' || type === 'commit') {
        // directory or submodule
        archive.append(null, { name: `${path}/` });
      } else {
        // blob
        const stream = await createBlobReadStream(repPath, oid);
        archive.append(stream, { name: path });
      }
    };
  
    return new Promise((resolve, reject) => {
      async.eachSeries(
        allEntries,
        async.asyncify(process),
        (err) => {
          if (err) {
            reject(err);
          } else {
            resolve(archive);
          }
        },
      );
    });
  }
docs: Serializes the specified git tree as an archive (zip/tgz).
  
  @param {string} repPath git repository path
  @param {object} tree git tree to process
  @param {object} archiver Archiver instance
  @returns {Promise<stream.Readable>} readable stream of archive