Skip to main content

commit_to_branch

Function commit_to_branch 

Source
pub fn commit_to_branch(
    root: &Path,
    branch: &str,
    rel_path: &str,
    content: &str,
    message: &str,
) -> Result<()>
Expand description

Commit a file to a specific branch without disturbing the current working tree.

If a permanent worktree exists for the branch, commits there directly. If the caller is already on the target branch, commits directly. Otherwise uses a temporary git worktree.