diff mbox series

[v2,2/2] negative-refspec: improve comment on query_matches_negative_refspec

Message ID 8da8d9cd1c5230aa3a62f1d339c5006d33630edd.1608415117.git.gitgitgadget@gmail.com (mailing list archive)
State Superseded
Headers show
Series negative-refspec: fix segfault on : refspec | expand

Commit Message

Nipunn Koorapati Dec. 19, 2020, 9:58 p.m. UTC
From: Nipunn Koorapati <nipunn@dropbox.com>

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>
---
 remote.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/remote.c b/remote.c
index cbb3113b105..6cdaa8da75a 100644
--- a/remote.c
+++ b/remote.c
@@ -736,6 +736,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];