code: func (h *buildTreeHelper) BuildTree(idx *index.Index) (plumbing.Hash, error) {
  	const rootNode = ""
  	h.trees = map[string]*object.Tree{rootNode: {}}
  	h.entries = map[string]*object.TreeEntry{}
  
  	for _, e := range idx.Entries {
  		if err := h.commitIndexEntry(e); err != nil {
  			return plumbing.ZeroHash, err
  		}
  	}
  
  	return h.copyTreeToStorageRecursive(rootNode, h.trees[rootNode])
  }
docs: // BuildTree builds the tree objects and push its to the storer, the hash
  // of the root tree is returned.