Skip to main content

copy_spec_to_worktree

Function copy_spec_to_worktree 

Source
pub fn copy_spec_to_worktree(spec_id: &str, worktree_path: &Path) -> Result<()>
Expand description

Copies the spec file from the main working directory to a worktree.

This ensures the worktree has the current spec state (e.g., in_progress status) even when the change hasn’t been committed to main yet.

§Arguments

  • spec_id - The specification ID
  • worktree_path - The path to the worktree

§Returns

Ok(()) if the spec file was successfully copied and committed.

§Errors

Returns an error if:

  • The spec file doesn’t exist in the main working directory
  • The copy operation fails
  • The commit fails