Skip to content
Snippets Groups Projects
Commit 74230abb2504 authored by Arseniy Alekseyev's avatar Arseniy Alekseyev
Browse files

match: strengthen visit_children_set invariant, Recursive means "all files"

My previous interpretation of "Recursive" was too relaxed: I thought it
instructed the caller to do something like this:

> you can stop calling `visit_children_set` because you'll need to descend into
> every directory recursively, but you should still check every file if it
> matches or not

Whereas the real instruction seems to be:

> I guarantee that everything in this subtree matches, you can stop
> querying the matcher for all files and dirs altogether.

The evidence to support this:

- the test actually passes with the stronger invariant, revealing no
exceptions from this rule

- the implementation of `visit_children_set` for `DifferenceMatcher`
clearly relies on this requirement, so it must hold for that not to
lead to bugs.
parent b39057b713b1
No related branches found
No related tags found
2 merge requests!845merge stable into default,!839match: tests and fixes for visitchildrenset
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment