(repo: &Repository, path: &str, text: &str)
| 20 | .to_base32() |
| 21 | } |
| 22 | fn write(repo: &Repository, path: &str, text: &str) { |
| 23 | let full = repo.root().join(path); |
| 24 | std::fs::create_dir_all(full.parent().unwrap()).unwrap(); |
| 25 | let tracked = full.exists(); |
| 26 | std::fs::write(full, text).unwrap(); |
| 27 | if !tracked { |
| 28 | repo.add( |
| 29 | repo.require_working_copy_id().unwrap(), |
| 30 | path, |
| 31 | TrackingOptions::default(), |
| 32 | ) |
| 33 | .unwrap(); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | fn command(root: &Path) -> Command { |
| 38 | let mut command = Command::new(env!("CARGO_BIN_EXE_atomic")); |
no test coverage detected