Skip to content

Commit

Permalink
Ignore files from .gitignore in Git loader (#2909)
Browse files Browse the repository at this point in the history
fixes #2905 

extends #2851
  • Loading branch information
cktang88 committed Apr 14, 2023
1 parent 7ee87eb commit 66bef1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions langchain/document_loaders/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ def load(self) -> List[Document]:

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
Expand Down

0 comments on commit 66bef1d

Please sign in to comment.