| 29 | } |
| 30 | |
| 31 | fn colocated() -> Self { |
| 32 | let fixture = Self::no_git(); |
| 33 | fixture.git_ok(&["init", "-q"]); |
| 34 | fixture.git_ok(&["symbolic-ref", "HEAD", "refs/heads/main"]); |
| 35 | fixture.git_ok(&["config", "user.name", "Atomic Test"]); |
| 36 | fixture.git_ok(&["config", "user.email", "atomic@example.com"]); |
| 37 | fixture.git_ok(&["config", "core.autocrlf", "false"]); |
| 38 | fixture.git_ok(&["config", "commit.gpgsign", "false"]); |
| 39 | // Snapshots below include all of .git. Automatic maintenance can |
| 40 | // outlive a commit and remove its lock while a snapshot walks it. |
| 41 | fixture.git_ok(&["config", "maintenance.auto", "false"]); |
| 42 | fs::write(fixture.root().join("tracked.txt"), b"checkpoint\n") |
| 43 | .expect("write initial tracked file"); |
| 44 | fixture.git_ok(&["add", "tracked.txt"]); |
| 45 | fixture.git_ok(&["commit", "--no-gpg-sign", "-q", "-m", "checkpoint"]); |
| 46 | fixture.atomic_ok(&["git", "import", "--no-vault"]); |
| 47 | fixture.atomic_ok(&["git", "shim", "reconcile"]); |
| 48 | assert!( |
| 49 | fixture |
| 50 | .root() |
| 51 | .join(".atomic/bridge/workspace.json") |
| 52 | .is_file(), |
| 53 | "Git reconciliation must establish a valid shim checkpoint" |
| 54 | ); |
| 55 | fixture |
| 56 | } |
| 57 | |
| 58 | fn root(&self) -> &Path { |
| 59 | self.repository.path() |