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

Method createInitialCommit

repository/git.go:205–209  ·  view source on GitHub ↗

createInitialCommit creates an empty commit with the environment creation message - this prevents multiple environments from overwriting the container-use-state on the parent commit

(ctx context.Context, worktreePath, id, title string)

Source from the content-addressed store, hash-verified

203
204// createInitialCommit creates an empty commit with the environment creation message - this prevents multiple environments from overwriting the container-use-state on the parent commit
205func (r *Repository) createInitialCommit(ctx context.Context, worktreePath, id, title string) error {
206 commitMessage := fmt.Sprintf("Create environment %s: %s", id, title)
207 _, err := RunGitCommand(ctx, worktreePath, "commit", "--allow-empty", "-m", commitMessage)
208 return err
209}
210
211func (r *Repository) propagateToWorktree(ctx context.Context, env *environment.Environment, explanation string) (rerr error) {
212 slog.Info("Propagating to worktree...",

Callers 1

CreateMethod · 0.95

Calls 1

RunGitCommandFunction · 0.85

Tested by

no test coverage detected