Reuse default import patterns

This commit is contained in:
2026-11-09 21:20:48 +00:00
parent f0198f865d
commit ef420c943b
2 changed files with 4 additions and 1 deletions

View File

@@ -187,6 +187,8 @@ basis for the analysis.
## Finding 6 — Skipped directory imports copy shared patterns per declaration ## Finding 6 — Skipped directory imports copy shared patterns per declaration
**Status** — Complete. Inherited directory policies borrow the read-only load snapshot. Import selection and no-base tests passed.
**Priority P3.** With no base, `acquireContextlessInput` calls **Priority P3.** With no base, `acquireContextlessInput` calls
`prepareImportDeclarations`, which holds one full resolved policy per `prepareImportDeclarations`, which holds one full resolved policy per
declaration. Each directory declaration that inherits the load-wide declaration. Each directory declaration that inherits the load-wide

View File

@@ -124,7 +124,8 @@ func resolveImportPolicy(spec importDeclarationSpec, defaults ImportDefaults) (r
if spec.patternSet { if spec.patternSet {
policy.pattern = cloneStrings(spec.pattern) policy.pattern = cloneStrings(spec.pattern)
} else { } else {
policy.pattern = cloneStrings(defaults.Pattern) // Defaults belong to the load's snapshot. Selectors only read them.
policy.pattern = defaults.Pattern
} }
} }
if spec.depthSet && !policy.recursive { if spec.depthSet && !policy.recursive {