From: Michael Haggerty Date: Tue, 16 Apr 2013 09:38:00 GMT Subject: Re: [PATCH 13/33] peel_ref(): fix return value for non-peelable, not-current reference Message-ID: <516D1BF8.9030009@alum.mit.edu> In-Reply-To: <7va9ozwv70.fsf@alter.siamese.dyndns.org> On 04/15/2013 07:38 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> The old version was inconsistent: when a reference was >> REF_KNOWS_PEELED but with a null peeled value, it returned non-zero >> for the current reference but zero for other references. Change the >> behavior for non-current references to match that of current_ref, >> which is what callers expect. Document the behavior. >> >> Current callers did not trigger the previously-buggy behavior. > > Is that because we were lucky by codeflow, or is it just that we > didn't have a testcase to trigger the behaviour? Existing callers only called peel_ref() from within a for_each_ref-style iteration and only for the current ref. Therefore the buggy code path was impossible to reach. I will note that in the commit message. Michael -- Michael Haggerty mhagger@alum.mit.edu http://softwareswirl.blogspot.com/