On Tue, Jun 18, 2024 at 7:46 PM Junio C Hamano <gitster@xxxxxxxxx> 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 <gitster@xxxxxxxxx>