Showing the changes to git-commitgraph/src (1 of 4 files). Show all
Unified · Split
| @@ -29,23 +29,15 @@ pub enum Error { · 28 unmodified lines | ||
| 29 | 29 | }, |
| 30 | 30 | #[error("{0}")] |
| 31 | 31 | Corrupt(String), |
| 32 | − #[error("Commit-graph file contains multiple {:?} chunks", .0.as_bstr())] | |
| 33 | − DuplicateChunk(ChunkId), | |
| 34 | 32 | // This error case is disabled, as git allows extra garbage in the extra edges list? |
| 35 | 33 | // #[error("The last entry in commit-graph's extended edges list does is not marked as being terminal")] |
| 36 | 34 | // ExtraEdgesOverflow, |
| 37 | − #[error("Commit-graph chunk {:?} has invalid size: {msg}", .id.as_bstr())] | |
| 38 | − InvalidChunkSize { id: ChunkId, msg: String }, | |
| 39 | 35 | #[error("Could not open commit-graph file at '{}'", .path.display())] |
| 40 | 36 | Io { |
| 41 | 37 | #[source] |
| 42 | 38 | err: std::io::Error, |
| 43 | 39 | path: std::path::PathBuf, |
| 44 | 40 | }, |
| 45 | − #[error("Missing required chunk {:?}", .0.as_bstr())] | |
| 46 | − MissingChunk(ChunkId), | |
| 47 | − #[error(transparent)] | |
| 48 | − MissingChunk2(#[from] git_chunk::file::index::offset_by_kind::Error), | |
| 49 | 41 | #[error("{0}")] |
| 50 | 42 | Trailer(String), |
| 51 | 43 | #[error("Commit-graph file uses unsupported hash version: {0}")] |
| @@ -54,6 +46,10 @@ pub enum Error { · 2 unmodified lines | ||
| 54 | 46 | UnsupportedVersion(u8), |
| 55 | 47 | #[error(transparent)] |
| 56 | 48 | ChunkFileDecode(#[from] git_chunk::file::decode::Error), |
| 49 | + #[error(transparent)] | |
| 50 | + MissingChunk(#[from] git_chunk::file::index::offset_by_kind::Error), | |
| 51 | + #[error("Commit-graph chunk {:?} has invalid size: {msg}", .id.as_bstr())] | |
| 52 | + InvalidChunkSize { id: ChunkId, msg: String }, | |
| 57 | 53 | } |
| 58 | 54 | |
| 59 | 55 | const TRAILER_LEN: usize = SHA1_SIZE; |
| @@ -211,7 +207,10 @@ impl TryFrom<&Path> for File { · 151 unmodified lines | ||
| 211 | 207 | } |
| 212 | 208 | |
| 213 | 209 | if base_graph_count > 0 && base_graphs_list_offset.is_none() { |
| 214 | − return Err(Error::MissingChunk(BASE_GRAPHS_LIST_CHUNK_ID)); | |
| 210 | + return Err(git_chunk::file::index::offset_by_kind::Error { | |
| 211 | + kind: BASE_GRAPHS_LIST_CHUNK_ID, | |
| 212 | + } | |
| 213 | + .into()); | |
| 215 | 214 | } |
| 216 | 215 | |
| 217 | 216 | let (fan, _) = read_fan(&data[fan_offset..]); |