Re: [PATCH v5 12/15] [GSOC] cat-file: reuse ref-filter logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Jun 25, 2021 at 9:32 PM ZheNing Hu via GitGitGadget
<gitgitgadget@xxxxxxxxx> wrote:
>
> From: ZheNing Hu <adlternative@xxxxxxxxx>
>
> +       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`:

```
        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.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux