- entry = create_tree_entry_list(tree);
- while (entry) {
- struct tree_entry_list *next = entry->next;
-
- if (entry->directory) {
- struct tree *tree = lookup_tree(entry->sha1);
+ desc.buf = tree->buffer;
+ desc.size = tree->size;
+ while (tree_entry(&desc, &entry)) {
+ if (S_ISDIR(entry.mode)) {
+ struct tree *tree = lookup_tree(entry.sha1);