code: async function collectTreeEntries(repPath, tree, result, treePath) {
    const entries = await Promise.all(tree.entries.map(async ({
      oid, type, mode, path,
    }) => ({
      oid, type, mode, path: joinPaths(treePath, path),
    })));
    result.push(...entries);
    // recurse into subtrees
    const treeEntries = entries.filter(entry => entry.type === 'tree');
    for (let i = 0; i < treeEntries.length; i += 1) {
      const { oid, path } = treeEntries[i];
      /* eslint-disable no-await-in-loop */
      const { object: subTree } = await getObject(repPath, oid);
      await collectTreeEntries(repPath, subTree, result, path);
    }
    return result;
  }
docs: Recursively collects all tree entries (blobs and trees).
  
  @param {string} repPath git repository path
  @param {object} tree git tree to process
  @param {Array<object>} result array where tree entries will be collected
  @param {string} treePath path of specified tree (will be prepended to child entries)
  @returns {Promise<Array<object>>} collected entries