Initialize tree descriptors with a helper function rather than by hand.
[git/git.git] / list-objects.c
index f1fa21c..2ba2c95 100644 (file)
@@ -49,8 +49,7 @@ static void process_tree(struct rev_info *revs,
        me.elem = name;
        me.elem_len = strlen(name);
 
-       desc.buf = tree->buffer;
-       desc.size = tree->size;
+       init_tree_desc(&desc, tree->buffer, tree->size);
 
        while (tree_entry(&desc, &entry)) {
                if (S_ISDIR(entry.mode))