(subdir string)
| 261 | } |
| 262 | |
| 263 | func normalizeWorkspaceRemoteSubdir(subdir string) (string, error) { |
| 264 | if subdir == "" { |
| 265 | return ".", nil |
| 266 | } |
| 267 | subdir = filepath.Clean(subdir) |
| 268 | subdir = strings.TrimPrefix(subdir, string(filepath.Separator)) |
| 269 | if subdir == "" || subdir == "." { |
| 270 | return ".", nil |
| 271 | } |
| 272 | if !filepath.IsLocal(subdir) { |
| 273 | return "", fmt.Errorf("path points outside repository: %q", subdir) |
| 274 | } |
| 275 | return subdir, nil |
| 276 | } |
| 277 | |
| 278 | // loadWorkspaceFromRemote clones a git repo and detects/loads the workspace from it. |
| 279 | func (srv *Server) loadWorkspaceFromRemote(ctx context.Context, client *daggerClient, remoteRef string) error { |
no outgoing calls