Re: [GSoC PATCH v9 3/5] repo: add the field layout.bare
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Aug 14, 2025, 18:32 UTC
- Message-ID
- <CAPig+cTQdEDZduG_UmdHn1JNfj7iTw0=jwdkX+VPJ11Jo0jUGA@mail.gmail.com>
- In-Reply-To
- <BCCE25CF-8546-4320-AB44-9B729C3D6DE6@gmail.com>
On Thu, Aug 14, 2025 at 2:23 PM Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> wrote:
Show 6 quoted lines
> > Since the documentation asserts that the emitted key/value lines will > > be sorted lexicographically, can we also have a test that verifies > > that behavior? > > Since we agreed to return the values in the order they were requested, > I'll test that order instead:
Yep, sounds good.
Show 9 quoted lines
> test_expect_success 'the values are returned in the same order they were requested' ' > printf "references.format=files\nlayout.bare=false\n" >expected1 && > printf "layout.bare=false\nreferences.format=files\n" >expected2 && > git init --ref-format=files same-order && > git -C same-order repo info references.format layout.bare >actual1 && > git -C same-order repo info layout.bare references.format >actual2 && > test_cmp expected1 actual1 && > test_cmp expected2 actual2 > '
Rather than the above, I think a more satisfactory and meaningful test would be:
test_expect_success 'values returned in order requested' '
cat >expect <<-\EOF &&
layout.bare=false
references.format=files
layout.bare=false
EOF
git init --ref-format=files ordered &&
git -C ordered repo info layout.bare references.format
layout.bare >actual &&
test_cmp expect actual
'