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

Function create_and_add_file

atomic-repository/tests/state_based_diff_test.rs:52–57  ·  view source on GitHub ↗

Helper to create a file in the repository and add it.

(repo: &Repository, repo_path: &Path, name: &str, content: &str)

Source from the content-addressed store, hash-verified

50
51/// Helper to create a file in the repository and add it.
52fn create_and_add_file(repo: &Repository, repo_path: &Path, name: &str, content: &str) {
53 let file_path = repo_path.join(name);
54 fs::write(&file_path, content).expect("Failed to write file");
55 repo.add(name, Default::default())
56 .expect("Failed to add file");
57}
58
59/// Helper to record a change with a message.
60fn record_change(repo: &Repository, message: &str) -> Hash {

Calls 2

writeFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected