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

Method MkdirAll

worktree_fs.go:125–138  ·  view source on GitHub ↗
(path string, perm os.FileMode)

Source from the content-addressed store, hash-verified

123}
124
125func (sfs *worktreeFilesystem) MkdirAll(path string, perm os.FileMode) error {
126 // MkdirAll on the worktree root is a no-op: the root always exists,
127 // so there is nothing to materialise. Mirroring the tolerance that
128 // validReadPath gives to read-side operations avoids breaking callers
129 // that walk a directory tree and pass the relative-to-root prefix
130 // ("") through to the worktree FS.
131 if path == "" || path == "." || path == "/" {
132 return nil
133 }
134 if err := sfs.validPath(path); err != nil {
135 return fmt.Errorf("mkdirall: %w", err)
136 }
137 return sfs.Filesystem.MkdirAll(path, perm)
138}
139
140func (sfs *worktreeFilesystem) TempFile(_, _ string) (billy.File, error) {
141 return nil, fmt.Errorf("tempfile: %w", errUnsupportedOperation)

Calls 1

validPathMethod · 0.95