Re: [GSoC Patch 1/7] repo: add path.toplevel with absolute and relative suffix formatting

K Jayatheerth <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <CA+rGoLf_BPjsxxSz0-DJgGos6iE_7mo=3FMvQsfNpgpFg99VRg@mail.gmail.com>
Hey Lucas,

On Sun, Aug 16, 2026 at 4:37 AM Lucas Seiki Oshiro
<[email protected]> wrote:
>
>
> >
> > +test_expect_success 'path.toplevel absolute and relative' '
> > + test_when_finished "rm -rf repo" &&
> > + git init repo &&
> > + (
> > + mkdir -p repo/sub &&
> > + cd repo/sub &&
> > +
> > + ROOT="$(test-tool path-utils real_path ..)" &&
> > +
> > + echo "path.toplevel.absolute=$ROOT" >expect.abs &&
> > + git repo info path.toplevel.absolute >actual.abs &&
> > + test_cmp expect.abs actual.abs &&
> > +
> > + echo "path.toplevel.relative=../" >expect.rel &&
> > + git repo info path.toplevel.relative >actual.rel &&
> > + test_cmp expect.rel actual.rel
> > + )
> > +'
>
> Question: why not use `test_repo_info_path` here?

test_repo_info_path doesn't quite fit path.toplevel as the helper assumes
an $expected_dir suffix and constructs $ROOT/$expected_dir and ../$expected_dir,
while toplevel is $ROOT and ../, respectively, therefore I made this
case different.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.