Re: [PATCH v6 7/7] ref-filter.c: parse trailers arguments with %(contents) atom
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Oct 2, 2017, 15:49 UTC
- Message-ID
- <20171002154916.GA39723@D-10-157-251-166.dhcp4.washington.edu>
- In-Reply-To
- <20171002065100.cjawz6pvxjj2w5nr@sigill.intra.peff.net>
On Mon, Oct 02, 2017 at 02:51:00AM -0400, Jeff King wrote:
Show 16 quoted lines
> > diff --git a/ref-filter.c b/ref-filter.c
> > index 43ed10a5e..6c26b4733 100644
> > --- a/ref-filter.c
> > +++ b/ref-filter.c
> > @@ -212,9 +212,10 @@ static void contents_atom_parser(const struct ref_format *format, struct used_at
> > atom->u.contents.option = C_SIG;
> > else if (!strcmp(arg, "subject"))
> > atom->u.contents.option = C_SUB;
> > - else if (!strcmp(arg, "trailers"))
> > - atom->u.contents.option = C_TRAILERS;
> > - else if (skip_prefix(arg, "lines=", &arg)) {
> > + else if (skip_prefix(arg, "trailers", &arg)) {
> > + skip_prefix(arg, ":", &arg);
> > + trailers_atom_parser(format, atom, *arg ? NULL : arg);
>
> I think your logic is flipped. You want "*arg ? arg : NULL";Thank you for pointing this out. I should have run "make test" on this patch set (or, as you suggested, `git rebase -x "make test" HEAD~7`) before sending it out. I appreciate you catching my mistake, and I'll make sure to run "make test" more diligently in the future :-).
It sounds like Junio picked this up while queueing.
-- - Taylor