Skip to main content

commit_worktree_changes

Function commit_worktree_changes 

Source
pub fn commit_worktree_changes(cwd: &Path, message: &str) -> Result<bool, Error>
Expand description

Commit all changes in the specified worktree directory.

Runs git add -A followed by git commit -m <message> in the given directory. Uses an explicit cwd to avoid relying on the process-global current directory.

Returns:

  • Ok(true) if a commit was made
  • Ok(false) if there was nothing to commit
  • Err if git commands fail