MCPcopy Index your code
hub / github.com/dagger/dagger / normalizeWorkspaceRemoteSubdir

Function normalizeWorkspaceRemoteSubdir

engine/server/session_workspaces.go:263–276  ·  view source on GitHub ↗
(subdir string)

Source from the content-addressed store, hash-verified

261}
262
263func 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.
279func (srv *Server) loadWorkspaceFromRemote(ctx context.Context, client *daggerClient, remoteRef string) error {

Callers 2

parseWorkspaceRemoteRefFunction · 0.85

Calls

no outgoing calls

Tested by 1