Skip to content

Commit 4e04d1a

Browse files
authored
pythongh-122044: Don't error during gitignore filtering with no files (python#122045)
1 parent 7a6d4cc commit 4e04d1a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Tools/build/generate_sbom.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ def filter_gitignored_paths(paths: list[str]) -> list[str]:
108108
109109
'.gitignore:9:*.a Tools/lib.a'
110110
"""
111+
# No paths means no filtering to be done.
112+
if not paths:
113+
return []
114+
111115
# Filter out files in gitignore.
112116
# Non-matching files show up as '::<whitespace><path>'
113117
git_check_ignore_proc = subprocess.run(

0 commit comments

Comments
 (0)