Re: [PATCH v8 5/9] ref: port git-fsck(1) regular refs check for files backend
- From
shejialuo <shejialuo@gmail.com>
- Date
- Nov 15, 2024, 11:08 UTC
- Message-ID
- <Zzcrkd0aetRjUHKA@ArchLinux>
- In-Reply-To
- <Zzbz_4Xqt39JZfgU@pks.im>
On Fri, Nov 15, 2024 at 08:11:01AM +0100, Patrick Steinhardt wrote:
Show 5 quoted lines
> On Fri, Nov 15, 2024 at 12:54:28AM +0800, shejialuo wrote:
> > + if (strbuf_read_file(&ref_content, iter->path.buf, 0) < 0 ) {
>
> Nit: there's a space too much here now.
> I will improve this in the next version.
Show 18 quoted lines
> > + /*
> > + * Ref file could be removed by another concurrent process. We should
> > + * ignore this error and continue to the next ref.
> > + */
> > + if (errno == ENOENT)
> > + goto cleanup;
> > +
> > + ret = error_errno(_("cannot read ref file '%s': %s"),
> > + iter->path.buf, strerror(errno));
> > + goto cleanup;
> > + }
>
> You report `errno` twice. This should be:
>
> ret = error_errno(_("cannot read ref file '%s'"), iter->path.buf);
>
> Other than that this version looks good to me, thanks!
> Opps, I didn't think about it, I just copied it. I will fix this in the next version.
> Patrick