We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 952eed4 commit 5bb4b11Copy full SHA for 5bb4b11
relay-cabi/src/codeowners.rs
@@ -65,12 +65,14 @@ fn translate_codeowners_pattern(pattern: &str) -> Option<Regex> {
65
let trailing_slash = pattern_vec.get(i + 2) == Some(&'/');
66
67
if (left_anchored || leading_slash) && (right_anchored || trailing_slash) {
68
- regex += ".*";
69
- num_to_skip = Some(2);
70
- // Allows the trailing slash after ** to be optional
71
if trailing_slash {
72
- regex += "/?";
+ // **/ matches zero or more complete path segments
+ regex += "(?:.*/)?";
73
num_to_skip = Some(3);
+ } else {
+ // ** at end matches anything
74
+ regex += ".*";
75
+ num_to_skip = Some(2);
76
}
77
continue;
78
0 commit comments