Skip to content

Commit 773c694

Browse files
nipunn1313gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 18f9c98 commit 773c694

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

remote.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,12 @@ static int query_matches_negative_refspec(struct refspec *rs, struct refspec_ite
740740
* item uses the destination. To handle this, we apply pattern
741741
* refspecs in reverse to figure out if the query source matches any
742742
* of the negative refspecs.
743+
*
744+
* The first loop finds and expands all positive refspecs
745+
* matched by the queried ref.
746+
*
747+
* The second loop checks if any of the results of the first loop
748+
* match any negative refspec.
743749
*/
744750
for (i = 0; i < rs->nr; i++) {
745751
struct refspec_item *refspec = &rs->items[i];

0 commit comments

Comments
 (0)