diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-01-07 03:22:44 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-01-07 03:22:44 +0900 |
| commit | 5eefebcb48ac1be682ea50a23c544df93b04dc07 (patch) | |
| tree | 7fde47cef4dee0fc10448700bedd58d8b791672d /internal/pkg/dir.go | |
| parent | 8e08e8f51882fd8152eec349117f4f8dd7e056f0 (diff) | |
internal/pkg: reject entry types disallowed in the cache
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>
Diffstat (limited to 'internal/pkg/dir.go')
| -rw-r--r-- | internal/pkg/dir.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/pkg/dir.go b/internal/pkg/dir.go index 3e7ad6c2..e446c569 100644 --- a/internal/pkg/dir.go +++ b/internal/pkg/dir.go @@ -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) |
