Skip to main content

create

Function create 

Source
pub fn create(volume_root: &Path, run_id: &str) -> Result<PathBuf, Error>
Expand description

Create a detached-HEAD worktree at .omne/wt/<run_id>.

Returns the absolute (or volume-relative, as git prints it) worktree path on success. The parent .omne/wt/ directory is created on demand so create is safe to call before scaffold has ever touched the worktree root (useful in tests).

create does not call preflight_volume_path_lengthomne run runs preflight earlier so failures surface before any ULID is minted. Callers invoking create directly must run preflight themselves if they want early path-length diagnosis.

Errors:

  • AlreadyExists if the target path exists before the git call.
  • NotAGitRepo if git reports the volume root is not a repo.
  • GitTimeout if the subprocess exceeds GIT_TIMEOUT.
  • GitCommandFailed for any other non-zero git exit.
  • Io if the git binary cannot be launched.