From: Junio C Hamano Date: Tue, 03 Oct 2006 04:14:46 GMT Subject: Re: [PATCH] lock_ref_sha1_basic does not remove empty directories on BSD Message-ID: <7vu02mt4qx.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <20061002172353.G44b12bbc@leonov.stosberg.net> Dennis Stosberg writes: > lock_ref_sha1_basic relies on errno beeing set to EISDIR by the > call to read() in resolve_ref() to detect directories. But calling > read() on a directory under NetBSD returns EPERM, and even succeeds > for local filesystems on FreeBSD. > > Signed-off-by: Dennis Stosberg Thanks. I've always wondered about the code that follows where you patched. It relies on either open() on a directory to fail, or read() from a file descriptor to return something other than what starts with 40-byte hexadecimal (or "ref: blah") to skip directories. You might probably meant the patch primarily to fix the leftover empty directories issue in "next", but it is also the right thing to do for "master" (and even for "maint"), I think. I'll apply it to "master" and then merge it into "next".