blob: a080d56ded1d5203e551ce9fcb51b64c60c52c60 (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
package resolve
import (
"io/fs"
objectid "codeberg.org/lindenii/furgit/object/id"
"codeberg.org/lindenii/furgit/object/tree"
)
// 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 *tree.TreeEntry
}
var (
_ fs.FS = (*TreeFS)(nil)
_ fs.ReadFileFS = (*TreeFS)(nil)
_ fs.ReadDirFS = (*TreeFS)(nil)
_ fs.StatFS = (*TreeFS)(nil)
_ fs.SubFS = (*TreeFS)(nil)
)
|