(root: &Path)
| 101 | |
| 102 | #[allow(dead_code)] |
| 103 | fn all_git_objects(root: &Path) -> Vec<u8> { |
| 104 | let out = Command::new("git") |
| 105 | .args(["cat-file", "--batch-all-objects", "--batch"]) |
| 106 | .current_dir(root) |
| 107 | .output() |
| 108 | .expect("git cat-file --batch-all-objects"); |
| 109 | assert!( |
| 110 | out.status.success(), |
| 111 | "git cat-file failed: {}", |
| 112 | output_text(&out) |
| 113 | ); |
| 114 | out.stdout |
| 115 | } |
| 116 | |
| 117 | fn contains_subslice(haystack: &[u8], needle: &[u8]) -> bool { |
| 118 | if needle.is_empty() || haystack.len() < needle.len() { |