Glen Choo <chooglen@xxxxxxxxxx> writes: > +struct submodule_entry_list * > +submodules_of_tree(struct repository *r, const struct object_id *treeish_name) > +{ > + struct tree_desc tree; > + struct name_entry entry; > + struct submodule_entry_list *ret; > + > + CALLOC_ARRAY(ret, 1); > + fill_tree_descriptor(r, &tree, treeish_name); > + while (tree_entry(&tree, &entry)) { I think that tree_entry() doesn't recurse into subtrees, but in any case we should test this. (I looked at patch 4 and I think that the submodules are always in the root tree.) This reminded me of a similar thing when fetching submodules recursively and we needed the "before" and "after" of submodule gitlinks. You can look at the code (collect_changed_submodules_cb() and the functions that use it in submodule.c) but it may not be useful - in particular, that uses diff since we need to see differences there, but we don't need that here. I'll review the other patches tomorrow.