Reuse unsafeIndexRootReason before scanning indexed subprojects so stray manifests at home or broader roots cannot inject unrelated context. Preserve workspace adoption for #964. Validation: four new regressions fail before the guard and pass after it; 48 relevant tests and npm run build pass. Confirmed the real os.homedir() leak before and after the fix with fixture cleanup. Co-authored-by: Colby McHenry <colbymchenry@users.noreply.github.com>
This commit is contained in:
co-authored by
Colby McHenry
parent
4453310eef
commit
3193800bc8
@@ -213,6 +213,8 @@ export function findIndexedSubprojectRoots(
|
||||
root: string,
|
||||
opts: { maxDepth?: number; max?: number } = {},
|
||||
): string[] {
|
||||
// A stray workspace manifest must not enable scanning home or broader roots (#1454).
|
||||
if (unsafeIndexRootReason(root) !== null) return [];
|
||||
const maxDepth = opts.maxDepth ?? 4;
|
||||
const max = opts.max ?? 64;
|
||||
const out: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user