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

Method with_base_files

atomic-cli/tests/it/agent_git_commit_absorb_test.rs:35–63  ·  view source on GitHub ↗

[`Fixture::new`] with more files in the base commit.

(files: &[(&str, &str)])

Source from the content-addressed store, hash-verified

33
34 /// [`Fixture::new`] with more files in the base commit.
35 fn with_base_files(files: &[(&str, &str)]) -> Self {
36 let dir = tempfile::tempdir().unwrap();
37 let fixture = Self { dir };
38 fixture.git(&["init", "-q", "-b", "main"]);
39 fs::write(fixture.root().join("tracked.txt"), b"base\n").unwrap();
40 fixture.git(&["add", "tracked.txt"]);
41 for (path, content) in files {
42 fixture.write(path, content);
43 fixture.git(&["add", path]);
44 }
45 fixture.git(&["commit", "-q", "-m", "base"]);
46 fixture.atomic(&["git", "import", "--no-vault"]);
47 let key = fixture.root().join(".atomic/test-binding.key");
48 fs::write(&key, "11".repeat(32)).unwrap();
49 fixture.atomic(&[
50 "git",
51 "shim",
52 "enable",
53 "--no-refspecs",
54 "--binding-key-file",
55 key.to_str().unwrap(),
56 ]);
57 fixture.atomic(&["git", "shim", "reconcile"]);
58 assert!(
59 fixture.root().join(".git/hooks/pre-commit").exists(),
60 "shim enable installs the commit-time capture dispatcher"
61 );
62 fixture
63 }
64
65 fn root(&self) -> &Path {
66 self.dir.path()

Callers

nothing calls this directly

Calls 6

writeFunction · 0.70
unwrapMethod · 0.45
gitMethod · 0.45
rootMethod · 0.45
writeMethod · 0.45
atomicMethod · 0.45

Tested by

no test coverage detected