aboutsummaryrefslogtreecommitdiff
path: root/object/fetch
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-30 08:34:28 +0000
committerGravatar Runxi Yu2026-03-30 08:34:28 +0000
commitf82bdff5f944cffb2017018aca2f96704dae5b3a (patch)
tree2889d89f7f9d0b1e6a67e57759c698d5fe028cd7 /object/fetch
parentobject/tree: Why wasn't I binary searching for remove (diff)
signatureNo signature
object/fetch: Use the new path splitting API v0.1.155
Diffstat (limited to 'object/fetch')
-rw-r--r--object/fetch/treefs_entry.go2
-rw-r--r--object/fetch/treefs_path.go20
2 files changed, 2 insertions, 20 deletions
diff --git a/object/fetch/treefs_entry.go b/object/fetch/treefs_entry.go
index 885e5afe..11c0ae23 100644
--- a/object/fetch/treefs_entry.go
+++ b/object/fetch/treefs_entry.go
@@ -23,7 +23,7 @@ func (treeFS *TreeFS) resolvePath(op treeFSOp, name string) (treeEntryValue, err
}, 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)
}
diff --git a/object/fetch/treefs_path.go b/object/fetch/treefs_path.go
index 7aa31c7f..a2dc3155 100644
--- a/object/fetch/treefs_path.go
+++ b/object/fetch/treefs_path.go
@@ -1,29 +1,11 @@
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 {
return &fs.PathError{Op: op.pathErrorOp(), Path: path, Err: err}
}