Skip to main content

apply_commit

Function apply_commit 

Source
pub fn apply_commit(plan: &CommitPlan, cwd_host_root: &Path) -> Result<()>
Expand description

Apply plan to disk per AUX-006: write every haz.yml first, then .haz/workspace.yml last, each via the rename-into-place pattern.

cwd_host_root is the host filesystem location that becomes the workspace root; the function joins workspace-absolute paths from plan against it to compute host paths.

ยงErrors

Returns a miette::Report on any filesystem failure (mkdir, tmp write, fsync, rename). The function makes no attempt to roll back files written earlier in the sequence; the haz.yml-then-workspace.yml ordering is itself the safety property AUX-006 names: an interrupted run leaves a consistent state because workspace.yml never references missing haz.ymls.