"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: got branch -d doesn't remove empty parent directory in reference
To:
Martijn van Duren <openbsd+got@list.imperialat.at>
Cc:
Gameoftrees <gameoftrees@openbsd.org>
Date:
Thu, 17 Sep 2026 11:07:45 +0200

Download raw body.

Thread
On Thu, Sep 17, 2026 at 10:57:21AM +0200, Martijn van Duren wrote:
> Works for me.
> 
> I am wondering why you add the ENOENT check? If the parent directory
> doesn't exist, wouldn't that be a race against someone who doesn't
> adhere to locking policy, or is there a genuine use-case where the
> parent directory could vanish before we call rmdir(2)?

It's just to cover the race with other rmdir calls, e.g. if someone
decides to run find -empty -delete on the repository or something
stupid like that.

Generally, we are trying to avoid erroring out for reasons which
we don't need to complain about. Assuming that's even possible with
the long list of potential errno values of rmdir, and inconsistencies
between operating system platforms.