ref: f82bdff5f944cffb2017018aca2f96704dae5b3a
parent: 22f7dcbf39e064de83ba56ed2aaf20bd64b239aa
author: Runxi Yu <runxiyu@umich.edu>
date: Mon Mar 30 04:34:28 EDT 2026
object/fetch: Use the new path splitting API
--- a/object/fetch/treefs_entry.go
+++ b/object/fetch/treefs_entry.go
@@ -23,7 +23,7 @@
}, nil
}
- entry, err := treeFS.fetcher.Path(treeFS.rootTree, treeFSSplitPath(name))
+ entry, err := treeFS.fetcher.Path(treeFS.rootTree, tree.SplitPath([]byte(name)))
if err != nil { return treeEntryValue{}, treeFS.pathResolveError(op, name, err)}
--- a/object/fetch/treefs_path.go
+++ b/object/fetch/treefs_path.go
@@ -1,27 +1,9 @@
package fetch
-import (
- "io/fs"
- "strings"
-)
+import "io/fs"
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 {--
⑨