On 03/18/2017 03:03 AM, Nguyễn Thái Ngọc Duy wrote: > refs is learning to avoid path rewriting that is done by > strbuf_git_path_submodule(). Factor out this code so it could be reused > by refs* Is the "*" on the previous line is a typo, or did you want to add a footnote, or ...? > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> > --- > path.c | 35 +++++++---------------------------- > submodule.c | 36 ++++++++++++++++++++++++++++++++++++ > submodule.h | 1 + > 3 files changed, 44 insertions(+), 28 deletions(-) > > [...] > diff --git a/submodule.c b/submodule.c > index 3200b7bb2b..3c445f274e 100644 > --- a/submodule.c > +++ b/submodule.c > @@ -1596,3 +1596,39 @@ const char *get_superproject_working_tree(void) > > return ret; > } > + > +/* > + * Given a submodule path (as in the index), return the repository > + * path of that submodule in 'buf'. Return -1 on error or when the > + * submodule is not initialized. > + */ Thanks for writing a docstring, but given that this is a public function, I think it is preferred to put the docstring in the header file. > [...] Michael