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

Function signed_turn_repo

atomic-agent/src/record/tests.rs:2187–2210  ·  view source on GitHub ↗

Set up a repository with one recorded file and a forked session view, ready for a turn to be recorded into.

(repo_root: &Path)

Source from the content-addressed store, hash-verified

2185/// Set up a repository with one recorded file and a forked session view,
2186/// ready for a turn to be recorded into.
2187fn signed_turn_repo(repo_root: &Path) -> String {
2188 use atomic_repository::Repository;
2189
2190 std::fs::write(repo_root.join("sign-me.txt"), "first\n").unwrap();
2191 {
2192 let mut repo = Repository::init(repo_root).unwrap();
2193 let working_copy = repo.require_working_copy_id().unwrap();
2194 repo.add(
2195 working_copy,
2196 "sign-me.txt",
2197 atomic_repository::tracking::TrackingOptions::default(),
2198 )
2199 .unwrap();
2200 let header = atomic_core::change::ChangeHeader::new("Add sign-me.txt");
2201 let options = atomic_repository::record::RecordOptions::new()
2202 .with_all(true)
2203 .save_to_store(true)
2204 .apply_after_record(true);
2205 repo.record(working_copy, header, options).unwrap();
2206 repo.create_view_from("session-signed", "dev").unwrap();
2207 }
2208
2209 "first\n".to_string()
2210}
2211
2212fn record_signed_turn(
2213 repo_root: &Path,

Calls 10

apply_after_recordMethod · 0.80
save_to_storeMethod · 0.80
create_view_fromMethod · 0.80
writeFunction · 0.50
initFunction · 0.50
unwrapMethod · 0.45
addMethod · 0.45
with_allMethod · 0.45
recordMethod · 0.45

Tested by

no test coverage detected