code: async function resolveTree(dir, refOrSha) {
    if (isValidSha(refOrSha)) {
      // full commit or tree sha
      return git.readObject({ dir, oid: refOrSha })
        .then((obj) => {
          if (obj.type === 'tree') {
            return obj;
          }
          if (obj.type === 'commit') {
            return git.readObject({ dir, oid: obj.object.tree });
          }
          throw new Error(`unexpected object: ${obj}`);
        });
    }
    // reference (branch, tag, shorthand commit sha)
    return resolveCommit(dir, refOrSha)
      .then(oid => git.readObject({ dir, oid }))
      .then(obj => git.readObject({ dir, oid: obj.object.tree }));
  }
docs: Returns the tree object identified directly by its sha
  or indirectly via reference (branch, tag or commit sha)
  
  @param {string} dir git repo path
  @param {string} refOrSha either tree sha or reference (branch, tag or commit sha)
  @returns {Promise<string>} commit oid of the curent commit referenced by `ref`
  @throws {GitError} `err.code === 'ResolveRefError'`: invalid reference
  `err.code === 'ReadObjectFail'`: not found