1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-05 10:36:11 +02:00

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 <nipunn@dropbox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nipunn Koorapati 2020-12-22 03:58:17 +00:00 committed by Junio C Hamano
parent 18f9c98845
commit 773c694142

View File

@ -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];