Re: [GSoC Patch 1/7] repo: add path.toplevel with absolute and relative suffix formatting
- From
K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
- Date
- Aug 18, 2026, 16:09 UTC
- Message-ID
- <CA+rGoLf_BPjsxxSz0-DJgGos6iE_7mo=3FMvQsfNpgpFg99VRg@mail.gmail.com>
- In-Reply-To
- <749F5FAC-5803-4E7A-AEC8-BA653D329EE2@gmail.com>
Hey Lucas,
On Sun, Aug 16, 2026 at 4:37 AM Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> wrote:
Show 23 quoted lines
> > > > > > +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.