From: Eric Sunshine Date: Wed, 19 Jun 2024 00:21:07 GMT Subject: Re: [PATCH 2/4] attr: notice and report read failure of .gitattributes files Message-ID: In-Reply-To: <20240618234436.4107855-3-gitster@pobox.com> On Tue, Jun 18, 2024 at 7:46 PM Junio C Hamano wrote: > The code that reads .gitattributes files was careless in dealing in > unusual circumstances. > > - It let read errors silently ignored. ECANTPARSE: perhaps? s/errors/& be/ > - It tried to read ".gitattributes" that is a directory on > platforms that allowed open(2) to open directories. > > To make the latter consistent with what we do for fopen() on > directories ("git grep" for FREAD_READS_DIRECTORIES for details), > check if we opened a directory, silently close it and return > success. Catch all read errors before we close and report as > needed. > > Signed-off-by: Junio C Hamano