Re: [GSoC Patch v7 3/8] repo: add path.superproject-root with absolute and relative suffixes
On Tue, Nov 3, 2026 at 3:13 AM Justin Tobler <jltobler@gmail.com> wrote:
Show 12 quoted lines
>
> On 26/09/27 05:14PM, K Jayatheerth wrote:
> > +static int get_path_superproject_absolute(struct repository *repo, struct strbuf *buf)
> > +{
> > + struct strbuf superproject = STRBUF_INIT;
> > +
> > + if (!get_superproject_working_tree(repo, &superproject)) {
> > + strbuf_release(&superproject);
> > + return 0;
>
> nit: The early return isn't really need here. This instead could be:
>Show 20 quoted lines
> if (get_superproject_working_tree(repo, &superproject))
> format_path(buf, superproject.buf, "", PATH_FORMAT_CANONICAL);
>
> > + }
> > +
> > + format_path(buf, superproject.buf, "", PATH_FORMAT_CANONICAL);
> > + strbuf_release(&superproject);
> > + return 0;
> > +}
> > +
> > +static int get_path_superproject_relative(struct repository *repo, struct strbuf *buf)
> > +{
> > + struct strbuf superproject = STRBUF_INIT;
> > +
> > + if (!get_superproject_working_tree(repo, &superproject)) {
> > + strbuf_release(&superproject);
> > + return 0;
>
> Same thing here.
>Show 9 quoted lines
> > + }
> > +
> > + format_path(buf, superproject.buf, repo->prefix, PATH_FORMAT_RELATIVE);
> > + strbuf_release(&superproject);
> > + return 0;
> > +}
>
> The rest of this patch looks good to me.
>