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

Function fixture

atomic-cli/tests/it/git_import_bypass_cycle_regression.rs:85–100  ·  view source on GitHub ↗

Build the four-state Git repository that reproduces the bypass-cycle byte loss: base file, prepend a section with a blank separator, insert two lines between the section and the blank, then delete one of them.

()

Source from the content-addressed store, hash-verified

83/// byte loss: base file, prepend a section with a blank separator, insert
84/// two lines between the section and the blank, then delete one of them.
85fn fixture() -> (PathBuf, PathBuf) {
86 let root = tempfile::tempdir().unwrap().keep();
87 let home = tempfile::tempdir().unwrap().keep();
88 git(&root, &["init", "-q", "-b", "main"]);
89 fs::create_dir_all(root.join("atomic-cli")).unwrap();
90 for (i, state) in [STATE_1, STATE_2, STATE_3, STATE_4].iter().enumerate() {
91 fs::write(root.join(PATH), state).unwrap();
92 git(&root, &["add", "."]);
93 if i == 0 {
94 git(&root, &["commit", "-q", "-m", "base file"]);
95 } else {
96 git(&root, &["commit", "-q", "-am", &format!("state {}", i + 1)]);
97 }
98 }
99 (root, home)
100}
101
102/// The graph-rendered bytes for `PATH` on `main`, read in-process exactly
103/// as another reader would.

Calls 4

gitFunction · 0.70
writeFunction · 0.70
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected