Skip to content

Commit

Permalink
avoid shouldIgnore on folders (#6255)
Browse files Browse the repository at this point in the history
Co-authored-by: Brace Sproul <braceasproul@gmail.com>
  • Loading branch information
DipFlip and bracesproul authored Jul 29, 2024
1 parent 9091012 commit 36d8479
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libs/langchain-community/src/document_loaders/web/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export class GithubRepoLoader
>[] = [];

for (const file of files) {
if (this.shouldIgnore(file.path, file.type)) {
if (file.type !== "dir" && this.shouldIgnore(file.path, file.type)) {
continue;
}
if (file.type === "file" && file.size === 0) {
Expand Down Expand Up @@ -566,7 +566,7 @@ export class GithubRepoLoader
): AsyncGenerator<Document, void, undefined> {
const files = await this.fetchRepoFiles(path);
for (const file of files) {
if (this.shouldIgnore(file.path, file.type)) {
if (file.type !== "dir" && this.shouldIgnore(file.path, file.type)) {
continue;
}

Expand Down Expand Up @@ -619,7 +619,7 @@ export class GithubRepoLoader
const files = await this.fetchRepoFiles(path);

for (const file of files) {
if (this.shouldIgnore(file.path, file.type)) {
if (file.type !== "dir" && this.shouldIgnore(file.path, file.type)) {
continue;
}

Expand Down

0 comments on commit 36d8479

Please sign in to comment.