| 452 | } |
| 453 | |
| 454 | fn recorded_repo() -> (tempfile::TempDir, Repository, atomic_core::types::Hash) { |
| 455 | let temp = tempfile::tempdir().unwrap(); |
| 456 | let repo = Repository::init(temp.path()).unwrap(); |
| 457 | std::fs::write(temp.path().join("f.txt"), "hello\n").unwrap(); |
| 458 | let working_copy = repo.require_working_copy_id().unwrap(); |
| 459 | repo.add(working_copy, "f.txt", Default::default()).unwrap(); |
| 460 | let hash = *repo |
| 461 | .record( |
| 462 | working_copy, |
| 463 | atomic_core::change::ChangeHeader::new("create file"), |
| 464 | atomic_repository::RecordOptions::default(), |
| 465 | ) |
| 466 | .unwrap() |
| 467 | .hash(); |
| 468 | (temp, repo, hash) |
| 469 | } |
| 470 | |
| 471 | #[test] |
| 472 | fn declining_or_failed_confirmation_preserves_source_and_working_copy() { |