MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / recorded_repo

Function recorded_repo

atomic-cli/src/commands/view/split.rs:454–469  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Calls 8

initFunction · 0.50
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
addMethod · 0.45
hashMethod · 0.45
recordMethod · 0.45