mach: fix test-tidy to handle missing merge commit (#32551)

This restores the behaviour prior to #32540 where the case where no
merge commit being found (which happens on CI in forks because we do
a shallow clone) is handled as if no changes where found.

Fixes #32550.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Mukilan Thiyagarajan 2024-06-19 12:31:58 +05:30 committed by GitHub
parent 24906e1c21
commit 4803514196
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -159,6 +159,8 @@ class FileList(object):
def _git_changed_files(self):
file_list = git_changes_since_last_merge(self.directory)
if not file_list:
return
for f in file_list:
if not any(os.path.join('.', os.path.dirname(f)).startswith(path) for path in self.excluded):
yield os.path.join('.', f)