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

Function seed

atomic-repository/src/repository/content.rs:1840–1853  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1838 }
1839
1840 fn seed() -> (tempfile::TempDir, Repository, Inode, Position<NodeId>) {
1841 let dir = tempfile::tempdir().unwrap();
1842 let repo = Repository::init(dir.path()).unwrap();
1843 let wc = repo.require_working_copy_id().unwrap();
1844 std::fs::write(dir.path().join("live.txt"), b"one\ntwo\nthree\n").unwrap();
1845 repo.add(wc, "live.txt", TrackingOptions::default())
1846 .unwrap();
1847 record(&repo, "seed");
1848 let txn = repo.pristine.read_txn().unwrap();
1849 let inode = txn.get_inode("live.txt").unwrap().unwrap();
1850 let position = txn.inode_position(inode).unwrap().unwrap();
1851 drop(txn);
1852 (dir, repo, inode, position)
1853 }
1854
1855 fn assert_verdict(repo: &Repository, inode: Inode, position: Position<NodeId>, expected: bool) {
1856 let txn = repo.pristine.read_txn().unwrap();

Calls 10

read_txnMethod · 0.80
recordFunction · 0.70
initFunction · 0.50
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
addMethod · 0.45
get_inodeMethod · 0.45
inode_positionMethod · 0.45