Fix Module 7 'watch it break' demo: git switch -c does NOT refuse on a dirty tree
#3
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Module 7's load-bearing motivation — you can't run two agents in one working directory because switching with uncommitted edits is refused — is demonstrated with a command that does the opposite.
git switch -c <new-branch>creates a new branch pointing at the current commit, carries the dirty edits over, and exits 0. The "would be overwritten by checkout" refusal only occurs when switching to an existing branch whose version of the file differs. A learner running the exact commands sees success, not the wall the prose claims ("Git stops you" / "Git refuses").Evidence
modules/07-worktrees-running-agents-in-parallel/README.md, Key concepts (~lines 60-68):and Part A (~lines 227-231). Verified on Git 2.53.0:
git switch -c feature/countafter editingcli.pycarried the edit over and exited 0 — no error.Why it matters
Violates the course's honesty/correctness promise and the exact-runnable-lab style of the locked exemplars: the central demonstration fails to fail. The worktrees concept itself is still valid; only the demo command is wrong.
Proposed change
Replace both sequences (Key concepts and Part A) with one that actually triggers the refusal, switching to an existing divergent branch:
feature/clear.feature/countoffmain.cli.py.git switch feature/clear→ produceserror: Your local changes ... would be overwritten by checkoutand exits 1.Reword the "Agent A is mid-change" framing so it fits a pre-existing divergent target branch, and update Part A's cleanup to match (drop any
feature/scratch/feature/otherthat no longer apply).Acceptance criteria
Affected files
modules/07-worktrees-running-agents-in-parallel/README.mdReferences
Source finding F2 (realVotes 3/3). Depends on branch switching from Module 6.
Filed from an adversarial multi-agent course review (217 raw findings → 54 adversarially-verified survivors). Scoped for manual review; intentionally not auto-assigned to an agent.