librelist archives

« back to archive

Wrong api for the submodule_foreach callback?

Wrong api for the submodule_foreach callback?

From:
Ignacio Casal Quinteiro
Date:
2012-09-29 @ 10:52
Hey guys,

GIT_EXTERN(int) git_submodule_foreach(
git_repository *repo,
int (*callback)(git_submodule *sm, const char *name, void *payload),
void *payload);

Some points while trying to bind it:
1) It is not consistent with the rest of the foreach api
2) what's the point for having the name parameter if you can get it from sm?
3) I would have expect it like in other apis to just have name and payload,
so you can query the actual submodule object from lookup_submodule inside
the callback

Is this intentional?

Regards.

-- 
Ignacio Casal Quinteiro