forked from Archives/langchain
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)
|
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
|
# uses filter to skip files
|
||||||
if self.file_filter and not self.file_filter(file_path):
|
if self.file_filter and not self.file_filter(file_path):
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user