MCPcopy
hub / github.com/go-git/go-git / validReadPath

Method validReadPath

worktree_fs.go:155–160  ·  view source on GitHub ↗

validReadPath is like validPath but treats the empty string and "." as valid references to the worktree root. Read-side operations on the root (e.g. ReadDir(""), Lstat(".")) are legitimate; mutating the root itself is not, so write-side operations continue to use validPath directly.

(p string)

Source from the content-addressed store, hash-verified

153// (e.g. ReadDir(""), Lstat(".")) are legitimate; mutating the root itself
154// is not, so write-side operations continue to use validPath directly.
155func (sfs *worktreeFilesystem) validReadPath(p string) error {
156 if p == "" || p == "." || p == "/" {
157 return nil
158 }
159 return sfs.validPath(p)
160}
161
162var errUnsupportedOperation = errors.New("unsupported operation")
163

Callers 6

OpenMethod · 0.95
StatMethod · 0.95
ReadDirMethod · 0.95
LstatMethod · 0.95
ReadlinkMethod · 0.95
ChrootMethod · 0.95

Calls 1

validPathMethod · 0.95

Tested by

no test coverage detected