code: func iterateCommitTrees(
  	seen map[plumbing.Hash]bool,
  	tree *object.Tree,
  	cb func(h plumbing.Hash),
  ) error {
  	if seen[tree.Hash] {
  		return nil
  	}
  
  	cb(tree.Hash)
  
  	treeWalker := object.NewTreeWalker(tree, true, seen)
  
  	for {
  		_, e, err := treeWalker.Next()
  		if err == io.EOF {
  			break
  		}
  		if err != nil {
  			return err
  		}
  
  		if e.Mode == filemode.Submodule {
  			continue
  		}
  
  		if seen[e.Hash] {
  			continue
  		}
  
  		cb(e.Hash)
  	}
  
  	return nil
  }
docs: // iterateCommitTrees iterate all reachable trees from the given commit