Skip to content

Commit

Permalink
perf: evaluate exclude/include filter matching only if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
vvagaytsev committed Dec 11, 2023
1 parent 6f6b593 commit 4850451
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/src/vcs/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,11 @@ export class GitHandler extends VcsHandler {
return
}

const passesExclusionFilter = matchPath(filePath, undefined, exclude)
if (hasIncludes && !passesExclusionFilter) {
return
if (hasIncludes) {
const passesExclusionFilter = matchPath(filePath, undefined, exclude)
if (!passesExclusionFilter) {
return
}
}

// We push to the output array if it passes through the exclude filters.
Expand Down

0 comments on commit 4850451

Please sign in to comment.