Re: [PATCH 14/19] [GSOC] cat-file: reuse ref-filter logic
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Jul 12, 2021, 13:26 UTC
- Message-ID
- <CAP8UFD1NfCXDVwaVWKvTWofFHbLee=JRzr4sQBecMMaqi0eWBw@mail.gmail.com>
- In-Reply-To
- <CAP8UFD0vHw8cK90RbOUcrAcxNKiHVTMX0VEiK8+MNyHH0CNm4A@mail.gmail.com>
On Mon, Jul 12, 2021 at 3:17 PM Christian Couder <christian.couder@gmail.com> wrote:
> > On Mon, Jul 12, 2021 at 1:47 PM ZheNing Hu via GitGitGadget > <gitgitgadget@gmail.com> wrote:
Show 26 quoted lines
> > +batch_test_atom() {
> > + if test "$3" = "fail"
> > + then
> > + test_expect_${4:-success} $PREREQ "basic atom: $1 $2 must fail" "
> > + test_must_fail git cat-file --batch-check='$2' >bad <<-EOF
> > + $1
> > + EOF
> > + "
> > + else
> > + test_expect_${4:-success} $PREREQ "basic atom: $1 $2" "
> > + git for-each-ref --format='$2' $1 >expected &&
> > + git cat-file --batch-check='$2' >actual <<-EOF &&
> > + $1
> > + EOF
> > + sanitize_pgp <actual >actual.clean &&
> > + cmp expected actual.clean
> > + "
> > + fi
> > +}
>
> I wonder if the above function and some of the tests below could be
> introduced in a preparatory patch before this one. It could help check
> that reusing ref-filter doesn't change the behavior with some atoms
> that were previously supported or rejected. Of course if some atoms
> are now failing or are now supported, then it's ok to add new tests
> for these atoms in this patch.For example maybe some of the tests could be introduced earlier when the reject_atom() function is introduced.