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.
()
| 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. |
| 85 | fn 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. |
no test coverage detected