Problem
Calling switch_branch only updates .osmos/HEAD with the target branch name without updating files on disk. If the user creates a commit on the new branch, it incorporates leftover files from the previous branch.
Proposed Solution
- Verify working directory is clean relative to current HEAD (or warn/stash).
- Clean files present in current HEAD and write files from target branch HEAD commit.
- Update .osmos/HEAD.
Acceptance Criteria
- Switching between branches replaces disk files with the target branch's snapshot.
- Prevents switching if dirty files would be overwritten.
Problem
Calling switch_branch only updates .osmos/HEAD with the target branch name without updating files on disk. If the user creates a commit on the new branch, it incorporates leftover files from the previous branch.
Proposed Solution
Acceptance Criteria