shithub: furgit

Download patch

ref: fc430714b9c94d23a22cca4690154e5a49983a35
parent: ad25bb029ae430ffadfe6afd86bab4eed33a9a76
author: Runxi Yu <runxiyu@umich.edu>
date: Wed Mar 25 00:55:16 EDT 2026

object/resolve: I guess document this about path?

--- a/object/resolve/path.go
+++ b/object/resolve/path.go
@@ -50,7 +50,15 @@
 //
 // parts must contain at least one path segment. Intermediate path segments
 // must resolve to tree entries. The final entry is returned without loading
-// its object.
+// its object. Path segments may not contain \x00.
+//
+// The path cannot be accurately represented as a string or a single []byte
+// because Git tree entry names may include slashes. While []string is
+// technically possible (since Go strings are not necessarily UTF-8), they
+// do often imply UTF-8 in practice, which would be undesirable.
+//
+// If your entry names are valid UTF-8 and uses / solely as segment separators,
+// it may be convenient to use TreeFS for an io/fs.FS-like interface.
 func (r *Resolver) Path(root objectid.ObjectID, parts [][]byte) (object.TreeEntry, error) {
 	if len(parts) == 0 {
 		return object.TreeEntry{}, &PathEmptyError{}
--