From: Junio C Hamano Date: Thu, 21 Mar 2024 17:35:19 GMT Subject: Re: [PATCH] reftable: fix tests being broken by NFS' delete-after-close semantics Message-ID: In-Reply-To: <8ac5e94a3930cdd2aee9ea86acda3155674b635c.1711035529.git.ps@pks.im> Patrick Steinhardt writes: > while ((d = readdir(dir))) { > - if (!strcmp(d->d_name, "..") || !strcmp(d->d_name, ".")) > + /* > + * Besides skipping over "." and "..", we also need to > + * skip over other files that have a leading ".". This > + * is due to behaviour of NFS, which will rename files > + * to ".nfs*" to emulate delete-on-last-close. > + * > + * In any case this should be fine as the reftable > + * library will never write files with leading dots > + * anyway. > + */ > + if (starts_with(d->d_name, ".")) > continue; Sounds good. We should count what we positively consider what we wrote, not random cruft somebody else might have dropped in the directory, and this is a good first thing to do. Will queue. Thanks.