Re: [PATCH v6 16/27] path.c: move some code out of strbuf_git_path_submodule()
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Mar 19, 2017, 20:47 UTC
- Message-ID
- <45b2b743-4eb0-3511-a48f-1a4725d67c36@alum.mit.edu>
- In-Reply-To
- <20170318020337.22767-17-pclouds@gmail.com>
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 ...?
Show 22 quoted lines
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> > --- > 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