Initialize tree descriptors with a helper function rather than by hand.
[git/git.git] / unpack-trees.c
index 2e2232c..ee10eea 100644 (file)
@@ -27,8 +27,7 @@ static struct tree_entry_list *create_tree_entry_list(struct tree *tree)
        if (!tree->object.parsed)
                parse_tree(tree);
 
-       desc.buf = tree->buffer;
-       desc.size = tree->size;
+       init_tree_desc(&desc, tree->buffer, tree->size);
 
        while (tree_entry(&desc, &one)) {
                struct tree_entry_list *entry;