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

Method new

atomic-cli/tests/it/git_cutover_cb13b_test.rs:107–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105
106impl Colocated {
107 fn new() -> Self {
108 let root = TempDir::new().expect("repo tempdir");
109 let home = TempDir::new().expect("home tempdir");
110 assert!(git_ok(&root, &["init", "-q", "-b", "main"]));
111 fs::write(root.path().join("tracked.txt"), b"anchor me\n").expect("write file");
112 assert!(git_ok(&root, &["add", "tracked.txt"]));
113 assert!(git_ok(&root, &["commit", "-qm", "anchor base"]));
114 atomic_ok(root.path(), home.path(), &["init", "--no-vault"]);
115 fs::remove_file(root.path().join(".atomicignore")).expect("remove atomicignore");
116 atomic_ok(root.path(), home.path(), &["git", "import", "--no-vault"]);
117 atomic_ok(
118 root.path(),
119 home.path(),
120 &[
121 "git",
122 "shim",
123 "enable",
124 "--binding-key-file",
125 key_file(home.path()).to_str().expect("utf8 key path"),
126 ],
127 );
128 atomic_ok(root.path(), home.path(), &["git", "shim", "reconcile"]);
129 Self { root, home }
130 }
131
132 fn root(&self) -> &Path {
133 self.root.path()

Callers

nothing calls this directly

Calls 4

writeFunction · 0.70
atomic_okFunction · 0.70
key_fileFunction · 0.70
pathMethod · 0.45

Tested by

no test coverage detected