Compute the changed files (with old/new contents) between the sandbox
branch and its parent, for the diff view. Runs against the original repo
(repo_path), which shares refs with the sandbox worktree.
Stage all changes and amend the current commit.
When message is Some, the commit message is replaced; when None the
existing message is kept (--no-edit).
Create a git worktree with a new branch.
If the branch already exists (e.g. from a previous session), prunes stale
worktrees and checks out the existing branch instead of creating a new one.
Detects the repo’s configured user and configures the worktree identity.