(name: &str)
| 225 | |
| 226 | impl WatchFixture { |
| 227 | fn new(name: &str) -> Self { |
| 228 | let root = TempDir::new().expect("repo tempdir"); |
| 229 | let home = TempDir::new().expect("home tempdir"); |
| 230 | assert!(git(root.path(), &["init", "-q", "-b", "main"]) |
| 231 | .status |
| 232 | .success()); |
| 233 | fs::write(root.path().join("tracked.txt"), b"anchor me\n").expect("write file"); |
| 234 | assert!(git(root.path(), &["add", "tracked.txt"]).status.success()); |
| 235 | assert!(git(root.path(), &["commit", "-qm", "anchor base"]) |
| 236 | .status |
| 237 | .success()); |
| 238 | atomic_ok(root.path(), home.path(), &["init", "--no-vault"]); |
| 239 | fs::remove_file(root.path().join(".atomicignore")).expect("remove atomicignore"); |
| 240 | atomic_ok(root.path(), home.path(), &["git", "import", "--no-vault"]); |
| 241 | atomic_ok( |
| 242 | root.path(), |
| 243 | home.path(), |
| 244 | &[ |
| 245 | "git", |
| 246 | "shim", |
| 247 | "enable", |
| 248 | "--binding-key-file", |
| 249 | key_file(home.path()).to_str().expect("utf8 key path"), |
| 250 | ], |
| 251 | ); |
| 252 | atomic_ok(root.path(), home.path(), &["git", "shim", "reconcile"]); |
| 253 | enable_watch(root.path()); |
| 254 | let _ = name; |
| 255 | Self { root, home } |
| 256 | } |
| 257 | |
| 258 | fn root(&self) -> &Path { |
| 259 | self.root.path() |
nothing calls this directly
no test coverage detected