(watch_enabled: bool)
| 318 | |
| 319 | impl EquivFixture { |
| 320 | fn build(watch_enabled: bool) -> Self { |
| 321 | let root = tempfile::TempDir::new().expect("equiv repo tempdir"); |
| 322 | let home = tempfile::TempDir::new().expect("equiv home tempdir"); |
| 323 | let root = root; |
| 324 | let home = home; |
| 325 | |
| 326 | git_ok(root.path(), &["init", "-q", "-b", "main"]); |
| 327 | fs::write(root.path().join("anchor.txt"), b"anchor me\n").expect("anchor file"); |
| 328 | make_corpus(root.path(), EQUIV_DIRS, EQUIV_FILES_PER_DIR, "v1"); |
| 329 | git_ok(root.path(), &["add", "-A"]); |
| 330 | git_ok(root.path(), &["commit", "-qm", "equiv corpus v1"]); |
| 331 | |
| 332 | atomic_ok(root.path(), home.path(), &["init", "--no-vault"]); |
| 333 | fs::remove_file(root.path().join(".atomicignore")).expect("remove atomicignore"); |
| 334 | atomic_ok(root.path(), home.path(), &["git", "import", "--no-vault"]); |
| 335 | atomic_ok( |
| 336 | root.path(), |
| 337 | home.path(), |
| 338 | &[ |
| 339 | "git", |
| 340 | "shim", |
| 341 | "enable", |
| 342 | "--binding-key-file", |
| 343 | key_file(home.path()).to_str().expect("utf8 key path"), |
| 344 | ], |
| 345 | ); |
| 346 | atomic_ok(root.path(), home.path(), &["git", "shim", "reconcile"]); |
| 347 | if watch_enabled { |
| 348 | enable_watch(root.path()); |
| 349 | } |
| 350 | Self { root, home } |
| 351 | } |
| 352 | |
| 353 | fn root(&self) -> &Path { |
| 354 | self.root.path() |
no test coverage detected