internal/pkg: reject entry types disallowed in the cache
All checks were successful
Test / Create distribution (push) Successful in 54s
Test / Sandbox (push) Successful in 2m59s
Test / ShareFS (push) Successful in 4m59s
Test / Sandbox (race detector) (push) Successful in 5m30s
Test / Hakurei (push) Successful in 5m38s
Test / Hpkg (push) Successful in 5m42s
Test / Hakurei (race detector) (push) Successful in 7m43s
Test / Flake checks (push) Successful in 1m46s

These are not encoded in the format, they are rejected here to serve as a check for cache since checksum is computed for every directory.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-07 03:22:44 +09:00
parent 8e08e8f518
commit 5eefebcb48
2 changed files with 40 additions and 20 deletions

View File

@@ -184,6 +184,8 @@ func Flatten(fsys fs.FS, root string, w io.Writer) (n int, err error) {
return err
}
ent.Data = []byte(newpath)
} else if !ent.Mode.IsDir() {
return InvalidFileModeError(ent.Mode)
}
nr, err = ent.Encode(w)