| 702 | } |
| 703 | |
| 704 | fn initialized_repository() -> tempfile::TempDir { |
| 705 | let root = tempfile::tempdir().expect("tempdir"); |
| 706 | git_ok(root.path(), &["init", "-q"]); |
| 707 | git_ok(root.path(), &["symbolic-ref", "HEAD", "refs/heads/main"]); |
| 708 | git_ok(root.path(), &["config", "user.name", "Atomic Test"]); |
| 709 | git_ok(root.path(), &["config", "user.email", "atomic@example.com"]); |
| 710 | fs::write(root.path().join("tracked.txt"), b"one\n").expect("write tracked"); |
| 711 | git_ok(root.path(), &["add", "tracked.txt"]); |
| 712 | git_ok(root.path(), &["commit", "-q", "-m", "initial"]); |
| 713 | root |
| 714 | } |
| 715 | |
| 716 | #[test] |
| 717 | fn capture_or_reuse_returns_identical_recovery_on_retry() { |