MCPcopy
hub / github.com/dagger/container-use / ReadWorktreeFile

Method ReadWorktreeFile

environment/integration/helpers.go:314–320  ·  view source on GitHub ↗

ReadWorktreeFile reads directly from an environment's worktree

(envID, path string)

Source from the content-addressed store, hash-verified

312
313// ReadWorktreeFile reads directly from an environment's worktree
314func (u *UserActions) ReadWorktreeFile(envID, path string) string {
315 worktreePath := u.WorktreePath(envID)
316 fullPath := filepath.Join(worktreePath, path)
317 content, err := os.ReadFile(fullPath)
318 require.NoError(u.t, err, "Failed to read worktree file")
319 return string(content)
320}
321
322// CorruptWorktree simulates worktree corruption for recovery testing
323func (u *UserActions) CorruptWorktree(envID string) {

Callers

nothing calls this directly

Calls 1

WorktreePathMethod · 0.95

Tested by

no test coverage detected