mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
Ignore files from .gitignore in Git loader (#2909)
fixes #2905 extends #2851
This commit is contained in:
parent
7ee87eb0c8
commit
66bef1d7ed
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user