Re: [PATCH v5 12/15] [GSOC] cat-file: reuse ref-filter logic
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Jun 27, 2021, 11:31 UTC
- Message-ID
- <CAOLTT8QOi0wYoouqaWn43CKR1bZT6U8v+T+6MMbq1R-4wjqBPg@mail.gmail.com>
- In-Reply-To
- <CA+CkUQ9jWY8KDJxeAk9kDSCGgQLuBuaLEASrGfbA2xnN7nuBBw@mail.gmail.com>
Hariom verma <hariom18599@gmail.com> 于2021年6月27日周日 上午1:27写道:
Show 27 quoted lines
>
> Hi,
>
> On Fri, Jun 25, 2021 at 9:32 PM ZheNing Hu via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
> >
> > From: ZheNing Hu <adlternative@gmail.com>
> >
> > + if (ret < 0) {
> > + die("%s\n", err.buf);
> > + } if (ret) {
> > + /* ret > 0 means when the object corresponding to oid
> > + * cannot be found in format_ref_array_item(), we only print
> > + * the error message.
> > + */
> > + printf("%s\n", err.buf);
> > + fflush(stdout);
> > + } else {
> > + strbuf_addch(scratch, '\n');
> > + batch_write(opt, scratch->buf, scratch->len);
> > }
> > + free_ref_array_item_value(&item);
> > + strbuf_release(&err);
> > }
>
> I think you can get rid of braces in condition `ret < 0`:
>Make sences. ;-)
Show 18 quoted lines
> ```
> if (ret < 0)
> die("%s\n", err->buf);
> if (ret) {
> /* ret > 0 means when the object corresponding to oid
> * cannot be found in format_ref_array_item(), we only print
> * the error message.
> */
> printf("%s\n", err->buf);
> fflush(stdout);
> } else {
> strbuf_addch(scratch, '\n');
> batch_write(opt, scratch->buf, scratch->len);
> }
> ```
>
> Thanks,
> Hariom.Thanks, ZheNing Hu