diff options
Diffstat (limited to 'pkg/subsystem')
| -rw-r--r-- | pkg/subsystem/linux/maintainers.go | 5 | ||||
| -rw-r--r-- | pkg/subsystem/linux/maintainers_test.go | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/pkg/subsystem/linux/maintainers.go b/pkg/subsystem/linux/maintainers.go index 00aedda0e..07c72fdad 100644 --- a/pkg/subsystem/linux/maintainers.go +++ b/pkg/subsystem/linux/maintainers.go @@ -209,7 +209,6 @@ var ( func wildcardToRegexp(wildcard string, store *strings.Builder) { store.WriteByte('^') - // We diverge a bit from the standard MAINTAINERS rule semantics. // path/* corresponds to the files belonging to the `path` folder, // but, since we also infer the parent-child relationship, it's @@ -231,7 +230,9 @@ func wildcardToRegexp(wildcard string, store *strings.Builder) { if tokenStart < len(wildcard) { store.WriteString(regexp.QuoteMeta(wildcard[tokenStart:])) } + // get_maintainers.pl script tolerates the absence of / when the wildcard + // points to a folder. Let's do the same. if wildcard == "" || wildcard[len(wildcard)-1] != '/' { - store.WriteByte('$') + store.WriteString("(?:" + escapedSeparator + "|$)") } } diff --git a/pkg/subsystem/linux/maintainers_test.go b/pkg/subsystem/linux/maintainers_test.go index f69485eae..0a0f5f75a 100644 --- a/pkg/subsystem/linux/maintainers_test.go +++ b/pkg/subsystem/linux/maintainers_test.go @@ -89,12 +89,13 @@ func TestRecordToPathRule(t *testing.T) { `with-subfolders/a`, `with-subfolders/a/b`, `dir/only-one`, + `dir/only-one/a.c`, + `dir/only-one/a/b.c`, `also-with-subfolders/a.c`, `also-with-subfolders/b/a.c`, }, noMatch: []string{ - `dir/only-one/a.c`, - `dir/only-one/a/b.c`, + `dir/only-one-plus-suffix`, }, }, { |
