| 123 | } |
| 124 | |
| 125 | func (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 | |
| 140 | func (sfs *worktreeFilesystem) TempFile(_, _ string) (billy.File, error) { |
| 141 | return nil, fmt.Errorf("tempfile: %w", errUnsupportedOperation) |