Commit c2092612 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

sparse: use the rust code even when sparse is present

With rust supporting more matcher types, we can now take this route in the
sparse case too.
parent bd3519dc6741
Pipeline #54911 passed with stage
in 28 minutes and 12 seconds
......@@ -1178,6 +1178,10 @@
return results
def _rust_status(self, matcher, list_clean, list_ignored, list_unknown):
if self._sparsematchfn is not None:
em = matchmod.exact(matcher.files())
sm = matchmod.unionmatcher([self._sparsematcher, em])
matcher = matchmod.intersectmatchers(matcher, sm)
# Force Rayon (Rust parallelism library) to respect the number of
# workers. This is a temporary workaround until Rust code knows
# how to read the config file.
......@@ -1296,8 +1300,6 @@
use_rust = False
elif subrepos:
use_rust = False
elif self._sparsematchfn is not None:
use_rust = False
elif not isinstance(match, allowed_matchers):
# Some matchers have yet to be implemented
use_rust = False
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment