(ctx context.Context, env *environment.Environment)
| 254 | } |
| 255 | |
| 256 | func (r *Repository) exportEnvironment(ctx context.Context, env *environment.Environment) error { |
| 257 | worktreePointer := fmt.Sprintf("gitdir: %s", filepath.Join(r.forkRepoPath, "worktrees", env.ID)) |
| 258 | |
| 259 | worktreePath, err := r.WorktreePath(env.ID) |
| 260 | if err != nil { |
| 261 | return fmt.Errorf("failed to get worktree path: %w", err) |
| 262 | } |
| 263 | |
| 264 | _, err = env.Workdir(). |
| 265 | WithNewFile(".git", worktreePointer). |
| 266 | Export( |
| 267 | ctx, |
| 268 | worktreePath, |
| 269 | dagger.DirectoryExportOpts{Wipe: true}, |
| 270 | ) |
| 271 | if err != nil { |
| 272 | return err |
| 273 | } |
| 274 | |
| 275 | return nil |
| 276 | } |
| 277 | func (r *Repository) propagateGitNotes(ctx context.Context, ref string) error { |
| 278 | fullRef := fmt.Sprintf("refs/notes/%s", ref) |
| 279 |
no test coverage detected