From: Junio C Hamano Date: Sun, 16 Oct 2011 05:10:11 GMT Subject: Re: [PATCH 3/5] remote: separate out the remote_find_tracking logic into query_refspecs Message-ID: <7vhb39ttcc.fsf@alter.siamese.dyndns.org> In-Reply-To: <7vobxhtugo.fsf@alter.siamese.dyndns.org> Junio C Hamano writes: > Carlos Martín Nieto 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 >> --- >> 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.