[3.13] gh-122044: Don't error during gitignore filtering with no files (GH-122045) (#122355)

Co-authored-by: Seth Michael Larson <[email protected]>
This commit is contained in:
Miss Islington (bot)
2024-07-27 14:34:08 +00:00
committed by GitHub
co-authored by Seth Michael Larson
parent 6496ffa47c
commit e122d2adfa
+4
View File
@@ -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 '::<whitespace><path>'
git_check_ignore_proc = subprocess.run(