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

Function preinit_record

atomic-cli/tests/it/git_shim_workspace_test.rs:99–116  ·  view source on GitHub ↗
(native: bool)

Source from the content-addressed store, hash-verified

97}
98
99fn preinit_record(native: bool) {
100 let f = Fixture::new(true);
101 let ignore = fs::read(f.root.path().join(".atomicignore")).unwrap();
102 fs::write(f.root.path().join("tracked.txt"), b"edit\n").unwrap();
103 let mut args = vec!["record", "-am", "edit"];
104 if native {
105 // This option uses the native command path rather than the local service.
106 args.push("--allow-conflict-markers");
107 }
108 f.atomic(&args);
109 f.assert_content("main", "tracked.txt", b"edit\n");
110 f.assert_content("main", ".atomicignore", &ignore);
111 assert_eq!(f.git(&["show", "HEAD:tracked.txt"]), "edit\n");
112 assert!(f.atomic(&["status", "--short"]).trim().is_empty());
113 assert!(f.git(&["status", "--porcelain"]).trim().is_empty());
114 f.atomic(&["git", "shim", "reconcile"]);
115 f.assert_content("main", "tracked.txt", b"edit\n");
116}
117
118#[test]
119fn native_addition_keeps_private_snapshot_conflict_cache_current() {

Calls 7

assert_contentMethod · 0.80
readFunction · 0.70
writeFunction · 0.70
unwrapMethod · 0.45
pathMethod · 0.45
pushMethod · 0.45
atomicMethod · 0.45

Tested by

no test coverage detected