Subject: Re: [PATCH v7 02/20] submodule--helper: refactor get_submodule_displaypath()

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Sat, 12 Feb 2022 15:24:11 +0100

On Thu, Feb 10 2022, Glen Choo wrote:

> From: Atharva Raykar <[email-masked]>
>
> We create a function called `do_get_submodule_displaypath()` that
> generates the display path required by several submodule functions, and
> takes a custom superprefix parameter, instead of reading it from the
> environment.
>
> We then redefine the existing `get_submodule_displaypath()` function
> as a call to this new function, where the superprefix is obtained from
> the environment.
>
> Mentored-by: Christian Couder <[email-masked]>
> Mentored-by: Shourya Shukla <[email-masked]>
> Signed-off-by: Atharva Raykar <[email-masked]>
> Signed-off-by: Ævar Arnfjörð Bjarmason <[email-masked]>
> Signed-off-by: Junio C Hamano <[email-masked]>
> ---
>  builtin/submodule--helper.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index 4c7c1e1432..5efceb9d46 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -261,11 +261,8 @@ static int resolve_relative_url_test(int argc, const char **argv, const char *pr
>  	return 0;
>  }
>  
> -/* the result should be freed by the caller. */
> -static char *get_submodule_displaypath(const char *path, const char *prefix)
> +static char *do_get_submodule_displaypath(const char *path, const char *prefix, const char *super_prefix)

Nit: overly long line (also in my v5, but since we're applying some
final polishing touches...)