[PATCH v5 2/2] negative-refspec: improve comment on query_matches_negative_refspec
- From
Nipunn Koorapati via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Dec 22, 2020, 03:58 UTC
- Message-ID
- <1f9af0e991c0b84cd00641322f2d76bdc8fbeb29.1608609498.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.820.v5.git.1608609498.gitgitgadget@gmail.com>
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 --git a/remote.c b/remote.c index 4f1a4099f1a..4d150a316ed 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];
-- gitgitgadget