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

Function write

atomic-cli/tests/review_comparison.rs:19–31  ·  view source on GitHub ↗
(repo: &Repository, path: &str, text: &str)

Source from the content-addressed store, hash-verified

17 .unwrap();
18}
19fn write(repo: &Repository, path: &str, text: &str) {
20 let full = repo.root().join(path);
21 let exists = full.exists();
22 std::fs::write(full, text).unwrap();
23 if !exists {
24 repo.add(
25 repo.require_working_copy_id().unwrap(),
26 path,
27 TrackingOptions::default(),
28 )
29 .unwrap();
30 }
31}
32fn command(root: &Path, args: &[&str]) -> std::process::Output {
33 Command::new(env!("CARGO_BIN_EXE_atomic"))
34 .current_dir(root)

Calls 5

rootMethod · 0.45
existsMethod · 0.45
unwrapMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected