fix(core): branch-keyed repository cache with gated reference readiness (#38759)

This commit is contained in:
Kit Langton 2026-07-24 21:23:44 -04:00 committed by GitHub
commit 065dc274ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 89 additions and 52 deletions

View file

@ -58,7 +58,6 @@ const layer = Layer.effect(
finalize: (draft) =>
Effect.gen(function* () {
materialized.clear()
const seen = new Map<string, string | undefined>()
for (const [name, source] of draft.list()) {
if (source.type === "local") {
materialized.set(
@ -82,14 +81,11 @@ const layer = Layer.effect(
continue
}
}
const target = Repository.cachePath(global.repos, repository)
if (seen.has(target) && seen.get(target) !== source.branch) continue
seen.set(target, source.branch)
materialized.set(
name,
new Info({
name,
path: AbsolutePath.make(target),
path: AbsolutePath.make(Repository.cachePath(global.repos, repository, source.branch)),
...(source.description === undefined ? {} : { description: source.description }),
...(source.hidden === undefined ? {} : { hidden: source.hidden }),
source,