I just looked into [`git_submodule_add_setup`](https://github.com/libgit2/libgit2/blob/development/src/submodule.c#L233) which seems to do the same thing. Maybe we can extract the *resolve parameters* block to an exposed function? I'll see if I can do it.