Subject: Re: [PATCH 3/5] remote: separate out the remote_find_tracking logic into query_refspecs

From: Junio C Hamano <[email-masked]>
Date: Sat, 15 Oct 2011 22:10:11 -0700

Junio C Hamano <[email-masked]> writes:

> Carlos Martín Nieto <[email-masked]> writes:
>
>> Move the body of remote_find_tracking to a new function query_refspecs
>> which does the same (find a refspec that matches and apply the
>> transformation) but explicitly wants the list of refspecs.
>>
>> Make remote_find_tracking and apply_refspecs use query_refspecs.
>>
>> Signed-off-by: Carlos Martín Nieto <[email-masked]>
>> ---
>>  remote.c |   70 ++++++++++++++++++++++++++++++-------------------------------
>>  1 files changed, 34 insertions(+), 36 deletions(-)
>
> Looks very sensible, especially knowing what you want to do in the next
> patch ;-).
>
> Thanks.

I notice that before this update, passing a refspec[] with an element that
lacks its dst side to apply_refspecs() would have segfaulted but with this
update such an element in the refspec[] will simply be ignored.

This helper function was added in 72ff894 (Allow helper to map private ref
names into normal names, 2009-11-18) for transport-helper's use. I am sure
the change will not introduce a regression due to this skippage (the code
without this patch would have simply crashed with such an input anyway),
but I thought people involved in the transport layer may want to know.