mirror of
https://github.com/Mintplex-Labs/langchain-python.git
synced 2026-07-19 21:33:31 -04:00
Ignore files from .gitignore in Git loader (#2909)
fixes #2905 extends #2851
This commit is contained in:
@@ -54,6 +54,10 @@ class GitLoader(BaseLoader):
|
||||
|
||||
file_path = os.path.join(self.repo_path, item.path)
|
||||
|
||||
ignored_files = repo.ignored([file_path])
|
||||
if len(ignored_files):
|
||||
continue
|
||||
|
||||
# uses filter to skip files
|
||||
if self.file_filter and not self.file_filter(file_path):
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user