Re: [PATCH 13/33] peel_ref(): fix return value for non-peelable, not-current reference
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Apr 16, 2013, 09:38 UTC
- 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:
Show 12 quoted lines
> Michael Haggerty <mhagger@alum.mit.edu> 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/