]> git.ipfire.org Git - thirdparty/git.git/commitdiff
negative-refspec: improve comment on query_matches_negative_refspec
authorNipunn Koorapati <nipunn@dropbox.com>
Tue, 22 Dec 2020 03:58:17 +0000 (03:58 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 Dec 2020 06:49:36 +0000 (22:49 -0800)
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>
remote.c

index b8ac91359b33322bdf9bec1d3287c5d36dc80303..1a5d8381ef4a7a74298a0a611678ea3a0381046a 100644 (file)
--- 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];