From 48035141966c907ee7cdd0cd73d55da0d3f866a0 Mon Sep 17 00:00:00 2001 From: Mukilan Thiyagarajan Date: Wed, 19 Jun 2024 12:31:58 +0530 Subject: [PATCH] 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 --- python/tidy/tidy.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/tidy/tidy.py b/python/tidy/tidy.py index 21179885148..b57a127c102 100644 --- a/python/tidy/tidy.py +++ b/python/tidy/tidy.py @@ -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)