ref: e7ce17381f525328073577d60583447fc9412c18
dir: /object/resolve/treefs.go/
package resolve
import (
"io/fs"
"codeberg.org/lindenii/furgit/object"
"codeberg.org/lindenii/furgit/objectid"
)
// TreeFS exposes one Git tree as an fs.FS.
//
// TreeFS interprets names using io/fs path rules. Those rules do not match raw
// Git tree entry naming exactly: names are UTF-8, slash-separated, and must be
// valid fs.FS paths. Tree entries that cannot be represented under those rules
// are not addressable through this API.
//
// TreeFS does not take ownership of its Resolver.
type TreeFS struct {
resolver *Resolver
rootTree objectid.ObjectID
rootEntry *object.TreeEntry
}
var (
_ fs.FS = (*TreeFS)(nil)
_ fs.ReadFileFS = (*TreeFS)(nil)
_ fs.ReadDirFS = (*TreeFS)(nil)
_ fs.StatFS = (*TreeFS)(nil)
_ fs.SubFS = (*TreeFS)(nil)
)