Showing the changes to git-commitgraph (2 of 18 files). Show all
Unified · Split
| @@ -175,10 +175,8 @@ fn verify_split_chain_filename_hash( · 174 unmodified lines | ||
| 175 | 175 | .and_then(|filename| filename.to_str()) |
| 176 | 176 | .and_then(|filename| filename.strip_suffix(".graph")) |
| 177 | 177 | .and_then(|stem| stem.strip_prefix("graph-")) |
| 178 | − .map_or(Ok(()), |hex| { | |
| 179 | − match git_hash::ObjectId::from_40_bytes_in_hex(hex.as_bytes()) { | |
| 180 | − Ok(actual) if actual.to_borrowed() == expected => Ok(()), | |
| 181 | − _ => Err(format!("graph-{}.graph", expected.to_sha1_hex().as_bstr())), | |
| 182 | − } | |
| 178 | + .map_or(Ok(()), |hex| match git_hash::ObjectId::from_hex(hex.as_bytes()) { | |
| 179 | + Ok(actual) if actual.to_borrowed() == expected => Ok(()), | |
| 180 | + _ => Err(format!("graph-{}.graph", expected.to_sha1_hex().as_bstr())), | |
| 183 | 181 | }) |
| 184 | 182 | } |
| @@ -76,7 +76,7 @@ pub fn fixture_path(path: &str) -> PathBuf { · 75 unmodified lines | ||
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | pub fn hex_to_id(hex: &[u8]) -> git_hash::ObjectId { |
| 79 | − git_hash::ObjectId::from_40_bytes_in_hex(hex).expect("40 bytes hex") | |
| 79 | + git_hash::ObjectId::from_hex(hex).expect("40 bytes hex") | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | pub struct RefInfo { |
| @@ -124,11 +124,11 @@ pub fn inspect_refs(repo_dir: impl AsRef<Path>, refs: &[&'static str]) -> HashMa · 41 unmodified lines | ||
| 124 | 124 | let parts = x.trim_end().split(' ').collect::<Vec<_>>(); |
| 125 | 125 | ( |
| 126 | 126 | parts[0].to_string(), |
| 127 | − git_hash::ObjectId::from_40_bytes_in_hex(parts[1].as_bytes()).expect("40 bytes hex"), | |
| 128 | − git_hash::ObjectId::from_40_bytes_in_hex(parts[2].as_bytes()).expect("40 bytes hex"), | |
| 127 | + git_hash::ObjectId::from_hex(parts[1].as_bytes()).expect("40 bytes hex"), | |
| 128 | + git_hash::ObjectId::from_hex(parts[2].as_bytes()).expect("40 bytes hex"), | |
| 129 | 129 | parts[3..] |
| 130 | 130 | .iter() |
| 131 | − .map(|x| git_hash::ObjectId::from_40_bytes_in_hex(x.as_bytes()).expect("40 bytes hex")) | |
| 131 | + .map(|x| git_hash::ObjectId::from_hex(x.as_bytes()).expect("40 bytes hex")) | |
| 132 | 132 | .collect(), |
| 133 | 133 | ) |
| 134 | 134 | }) |