(name: &str)
| 103 | |
| 104 | impl Colocated { |
| 105 | fn new(name: &str) -> Self { |
| 106 | let root = tempfile::TempDir::new().expect("repo tempdir"); |
| 107 | let home = tempfile::TempDir::new().expect("home tempdir"); |
| 108 | git_ok(root.path(), &["init", "-q", "-b", "main"]); |
| 109 | fs::write(root.path().join("tracked.txt"), b"anchor me\n").expect("write file"); |
| 110 | fs::create_dir(root.path().join("nested")).expect("nested dir"); |
| 111 | fs::write(root.path().join("nested/inner.txt"), b"inner\n").expect("write file"); |
| 112 | git_ok(root.path(), &["add", "tracked.txt", "nested/inner.txt"]); |
| 113 | git_ok(root.path(), &["commit", "-qm", "anchor base"]); |
| 114 | atomic_ok(root.path(), home.path(), &["init"]); |
| 115 | atomic_ok(root.path(), home.path(), &["git", "import", "--no-vault"]); |
| 116 | // The Anchor key must live outside the worktree: any untracked file |
| 117 | // breaks complete manifest equivalence by design (RFC §12.5). |
| 118 | let key = write_key_file(home.path(), &format!("{name}.hex"), 0x71); |
| 119 | Self { root, home, key } |
| 120 | } |
| 121 | |
| 122 | fn key(&self) -> &Path { |
| 123 | &self.key |
nothing calls this directly
no test coverage detected