From: Junio C Hamano Date: Mon, 02 Apr 2012 17:30:14 GMT Subject: Re: Bug: bad errno report from lock_ref_sha1_basic() when contents bad Message-ID: <7vhax2ghy1.fsf@alter.siamese.dyndns.org> In-Reply-To: <878viephzm.fsf@thomas.inf.ethz.ch> Thomas Rast writes: > As far as I can see lock_ref_sha1_basic() needs a similar check for > REF_ISBROKEN (and presumably the only fix is to nuke it so maybe it > should even suggest that to the user). Probably. > But in general, the "errno may > be crucial or worthless" interface of lock_ref_sha1_basic() seems a bit > broken... Sorry, but I am not sure what you mean by this. The function is fairly careful using errno to base its decision and even saves errno when it calls helpers that may overwrite it, so the "interface" does not want "may be crucial or worthless". The implementation may have been broken over time by many patches, but that is a different issue. Which codepaths clobber errno, and is it something you can easily fix with a patch or two?