From e27bb29ecaebc2615f723449129888864c349bb7 Mon Sep 17 00:00:00 2001 From: Lasse Mammen Date: Tue, 5 May 2020 10:27:25 +0100 Subject: [PATCH] Assume * when glob ends with forward slash --- marge/approvals.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/marge/approvals.py b/marge/approvals.py index 247f1295..4a18d9f7 100644 --- a/marge/approvals.py +++ b/marge/approvals.py @@ -64,7 +64,11 @@ def determine_responsible_owners(self, owners_glob, changes): for change in changes['changes']: for glob, users in owners_glob.items(): - if 'new_path' in change and fnmatch.fnmatch(change['new_path'], glob): + test_glob = glob + if glob.endswith('/'): + test_glob += "*" + + if 'new_path' in change and fnmatch.fnmatch(change['new_path'], test_glob): owners.update(users) return owners