Re: [PATCH 3/5] remote: separate out the remote_find_tracking logic into query_refspecs
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 16, 2011, 05:10 UTC
- Message-ID
- <7vhb39ttcc.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7vobxhtugo.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 17 quoted lines
> Carlos Martín Nieto <cmn@elego.de> 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 <cmn@elego.de> >> --- >> 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.