diff --git a/dist/cli.js b/dist/cli.js index 2693423..16a8cd1 100755 --- a/dist/cli.js +++ b/dist/cli.js @@ -12830,8 +12830,9 @@ function parseGitDiff(diffOutput) { } return files; } -function getGitDiff(repoDir, base = GIT.DEFAULT_BASE_REF) { - const output = execSync(`git diff ${base}...HEAD -- . ':(exclude)${AUTODOCS_DIR}'`, { +function getGitDiff(repoDir, base = GIT.DEFAULT_BASE_REF, extraExcludes = []) { + const excludes = [AUTODOCS_DIR, ...extraExcludes].map((p) => `':(exclude)${p}'`).join(" "); + const output = execSync(`git diff ${base}...HEAD -- . ${excludes}`, { cwd: repoDir, encoding: UTF8, maxBuffer: MAX_DIFF_BYTES diff --git a/dist/index.js b/dist/index.js index e6ccb95..24a9c6e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -5458,8 +5458,9 @@ function parseGitDiff(diffOutput) { } return files; } -function getGitDiff(repoDir, base = GIT.DEFAULT_BASE_REF) { - const output = execSync(`git diff ${base}...HEAD -- . ':(exclude)${AUTODOCS_DIR}'`, { +function getGitDiff(repoDir, base = GIT.DEFAULT_BASE_REF, extraExcludes = []) { + const excludes = [AUTODOCS_DIR, ...extraExcludes].map((p) => `':(exclude)${p}'`).join(" "); + const output = execSync(`git diff ${base}...HEAD -- . ${excludes}`, { cwd: repoDir, encoding: UTF8, maxBuffer: MAX_DIFF_BYTES diff --git a/src/differ/git-differ.ts b/src/differ/git-differ.ts index 214a8aa..760d9f6 100644 --- a/src/differ/git-differ.ts +++ b/src/differ/git-differ.ts @@ -34,9 +34,15 @@ export function parseGitDiff(diffOutput: string): ChangedFile[] { return files } -export function getGitDiff(repoDir: string, base = GIT.DEFAULT_BASE_REF): ChangedFile[] { - // Exclude the generated index dir so its churn never triggers doc updates. - const output = execSync(`git diff ${base}...HEAD -- . ':(exclude)${AUTODOCS_DIR}'`, { +export function getGitDiff( + repoDir: string, + base = GIT.DEFAULT_BASE_REF, + extraExcludes: string[] = [], +): ChangedFile[] { + const excludes = [AUTODOCS_DIR, ...extraExcludes] + .map(p => `':(exclude)${p}'`) + .join(' ') + const output = execSync(`git diff ${base}...HEAD -- . ${excludes}`, { cwd: repoDir, encoding: UTF8, maxBuffer: MAX_DIFF_BYTES,