Submitter | phabricator |
---|---|
Date | May 7, 2020, 10:16 p.m. |
Message ID | <differential-rev-PHID-DREV-jfpwvngx4zhs6gdiwmys-req@mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/46289/ |
State | Superseded |
Headers | show |
Comments
Patch
diff --git a/rust/hg-core/src/filepatterns.rs b/rust/hg-core/src/filepatterns.rs --- a/rust/hg-core/src/filepatterns.rs +++ b/rust/hg-core/src/filepatterns.rs @@ -189,7 +189,10 @@ // The `regex` crate accepts `**` while `re2` and Python's `re` // do not. Checking for `*` correctly triggers the same error all // engines. - if pattern[0] == b'^' || pattern[0] == b'*' { + if pattern[0] == b'^' + || pattern[0] == b'*' + || pattern.starts_with(b".*") + { return pattern.to_owned(); } [&b".*"[..], pattern].concat()