From: Nipunn Koorapati Date: Tue, 22 Dec 2020 03:58:17 +0000 (+0000) Subject: negative-refspec: improve comment on query_matches_negative_refspec X-Git-Tag: v2.30.0-rc2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=773c694142c630ccbf161287b5c2a7ad13e8ca9f;p=thirdparty%2Fgit.git negative-refspec: improve comment on query_matches_negative_refspec Comment did not adequately explain how the two loops work together to achieve the goal of querying for matching of any negative refspec. Signed-off-by: Nipunn Koorapati Signed-off-by: Junio C Hamano --- diff --git a/remote.c b/remote.c index b8ac91359b..1a5d8381ef 100644 --- a/remote.c +++ b/remote.c @@ -740,6 +740,12 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite * item uses the destination. To handle this, we apply pattern * refspecs in reverse to figure out if the query source matches any * of the negative refspecs. + * + * The first loop finds and expands all positive refspecs + * matched by the queried ref. + * + * The second loop checks if any of the results of the first loop + * match any negative refspec. */ for (i = 0; i < rs->nr; i++) { struct refspec_item *refspec = &rs->items[i];