From 4e04d1a3d237abd0cba354024556c39519e0d163 Mon Sep 17 00:00:00 2001 From: Seth Michael Larson Date: Sat, 27 Jul 2024 06:10:05 -0500 Subject: [PATCH] gh-122044: Don't error during gitignore filtering with no files (#122045) --- Tools/build/generate_sbom.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tools/build/generate_sbom.py b/Tools/build/generate_sbom.py index c08568f2e00326..1b000c3b16a17a 100644 --- a/Tools/build/generate_sbom.py +++ b/Tools/build/generate_sbom.py @@ -108,6 +108,10 @@ def filter_gitignored_paths(paths: list[str]) -> list[str]: '.gitignore:9:*.a Tools/lib.a' """ + # No paths means no filtering to be done. + if not paths: + return [] + # Filter out files in gitignore. # Non-matching files show up as '::' git_check_ignore_proc = subprocess.run(