Skip to content

Commit 8e1b2a4

Browse files
Merge pull request #1759 from mjpieters/issues/1758
Use a pipe to pass filenames to git check-ignore
2 parents 0ccefec + 84664a6 commit 8e1b2a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

isort/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,13 +547,13 @@ def _check_folder_gitignore(self, folder: str) -> Optional[Path]:
547547
files_result = (
548548
codecs.escape_decode( # type: ignore
549549
subprocess.check_output( # nosec # skipcq: PYL-W1510
550-
["git", "-C", str(git_folder), "check-ignore", *files]
550+
["git", "-C", str(git_folder), "check-ignore", "--stdin"],
551+
input="\n".join(files).encode(),
551552
)
552553
)[0]
553554
.decode("utf-8")
554-
.split("\n")
555+
.splitlines()
555556
)
556-
files_result = files_result[:-1] if files_result else files_result
557557

558558
self.git_ignore[git_folder] = {Path(f.strip('"')) for f in files_result}
559559

0 commit comments

Comments
 (0)