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

Function crash_final_project

atomic-repository/src/repository/git_stream.rs:1377–1402  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1375
1376 #[cfg(unix)]
1377 fn crash_final_project() -> (ProjectTree, VerifiedProspectiveEquivalence) {
1378 let policy = ConversionPolicy::new(GitHashAlgorithm::Sha1);
1379 let entries = [
1380 ("a.txt", b"one\n".as_slice()),
1381 ("b.txt", b"two\n".as_slice()),
1382 ("c.txt", b"three\n".as_slice()),
1383 ]
1384 .into_iter()
1385 .map(|(path, bytes)| {
1386 RepositoryEntry::new(
1387 RepoPath::from_bytes(path.as_bytes()).unwrap(),
1388 bytes.to_vec(),
1389 0o644,
1390 atomic_core::change::InodeKind::Regular,
1391 None,
1392 ManifestDisposition::Included,
1393 )
1394 .unwrap()
1395 })
1396 .collect();
1397 let manifest =
1398 RepositoryManifest::new(SetId::ZERO, policy.root().content_key, entries).unwrap();
1399 let project = ProjectTree::from_manifest(manifest, &policy).unwrap();
1400 let proof = crate::verify_prospective_equivalence(&project, &project.git.root).unwrap();
1401 (project, proof)
1402 }
1403 #[test]
1404 fn prepared_graph_boundary_rejects_file_ops() {
1405 let (project, _) = project();

Calls 7

collectMethod · 0.45
into_iterMethod · 0.45
as_sliceMethod · 0.45
unwrapMethod · 0.45
as_bytesMethod · 0.45
rootMethod · 0.45