From 29753cddc8007ac63754855d026fe5eca8897d04 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 9 Sep 2011 11:54:58 -0700 Subject: rename "match_refs()" to "match_push_refs()" Yes, there is a warning that says the function is only used by push in big red letters in front of this function, but it didn't say a more important thing it should have said: what the function is for and what it does. Rename it and document it to avoid future confusion. Signed-off-by: Junio C Hamano --- remote.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'remote.c') diff --git a/remote.c b/remote.c index b8ecfa5d95..536ffa35cd 100644 --- a/remote.c +++ b/remote.c @@ -1170,12 +1170,15 @@ static struct ref **tail_ref(struct ref **head) } /* - * Note. This is used only by "push"; refspec matching rules for - * push and fetch are subtly different, so do not try to reuse it - * without thinking. + * Given the set of refs the local repository has, the set of refs the + * remote repository has, and the refspec used for push, determine + * what remote refs we will update and with what value by setting + * peer_ref (which object is being pushed) and force (if the push is + * forced) in elements of "dst". The function may add new elements to + * dst (e.g. pushing to a new branch, done in match_explicit_refs). */ -int match_refs(struct ref *src, struct ref **dst, - int nr_refspec, const char **refspec, int flags) +int match_push_refs(struct ref *src, struct ref **dst, + int nr_refspec, const char **refspec, int flags) { struct refspec *rs; int send_all = flags & MATCH_REFS_ALL; -- cgit v1.2.1