`git_iterator_for_tree()` will do this allocation for you. You don't need to preallocate the object.