diff options
| author | 2026-03-25 19:33:32 +0000 | |
|---|---|---|
| committer | 2026-03-25 19:33:57 +0000 | |
| commit | 1aa5cad4c8d6455eeb1f10893549e18bcca11996 (patch) | |
| tree | 31082a30bde08639fc764c52c3cf2283489f3302 /object/fetch/treefs_path.go | |
| parent | TODO: updates (diff) | |
| signature | No signature | |
object/fetch: Rename from object/resolve
Diffstat (limited to 'object/fetch/treefs_path.go')
| -rw-r--r-- | object/fetch/treefs_path.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/object/fetch/treefs_path.go b/object/fetch/treefs_path.go new file mode 100644 index 00000000..7aa31c7f --- /dev/null +++ b/object/fetch/treefs_path.go @@ -0,0 +1,29 @@ +package fetch + +import ( + "io/fs" + "strings" +) + +func treeFSValidPath(name string) bool { + return name == "." || fs.ValidPath(name) +} + +func treeFSSplitPath(name string) [][]byte { + if name == "." { + return nil + } + + parts := strings.Split(name, "/") + + out := make([][]byte, len(parts)) + for i, part := range parts { + out[i] = []byte(part) + } + + return out +} + +func treeFSPathError(op treeFSOp, path string, err error) error { + return &fs.PathError{Op: op.pathErrorOp(), Path: path, Err: err} +} |
