summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorNipunn Koorapati <nipunn@dropbox.com>2020-12-22 03:58:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-12-22 06:49:36 (GMT)
commit773c694142c630ccbf161287b5c2a7ad13e8ca9f (patch)
tree4e91b7fcadd05cb00d49a4d08c6e3afb90b97eb7 /remote.c
parent18f9c9884582c743d8ba04ef5cbbe647947d2578 (diff)
downloadgit-773c694142c630ccbf161287b5c2a7ad13e8ca9f.zip
git-773c694142c630ccbf161287b5c2a7ad13e8ca9f.tar.gz
git-773c694142c630ccbf161287b5c2a7ad13e8ca9f.tar.bz2
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>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/remote.c b/remote.c
index b8ac913..1a5d838 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];