diff --git a/split_cl.py b/split_cl.py index 65dede163..5ed8a57b2 100644 --- a/split_cl.py +++ b/split_cl.py @@ -152,6 +152,10 @@ def GetFilesSplitByOwners(owners_database, files): files_split_by_owners = collections.defaultdict(list) for action, path in files: enclosing_dir = owners_database.enclosing_dir_with_owners(path) + # Anything matching a per-file rule will return its own path. + # Aggregate up to the parent directory so as not to over-split. + if enclosing_dir == path: + enclosing_dir = os.path.dirname(path) files_split_by_owners[enclosing_dir].append((action, path)) return files_split_by_owners