Showing the changes to git-commitgraph/src/file/init.rs (1 of 6 files). Show all
Unified · Split
| @@ -11,7 +11,9 @@ use std::{ · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | type ChunkId = [u8; 4]; |
| 13 | 13 | |
| 14 | +/// The error used in [`File::at()`]. | |
| 14 | 15 | #[derive(thiserror::Error, Debug)] |
| 16 | +#[allow(missing_docs)] | |
| 15 | 17 | pub enum Error { |
| 16 | 18 | #[error("Commit-graph {:?} chunk contains {from_chunk} base graphs, but commit-graph file header claims {from_header} base graphs", BASE_GRAPHS_LIST_CHUNK_ID.as_bstr())] |
| 17 | 19 | BaseGraphMismatch { from_header: u8, from_chunk: u32 }, |
| @@ -63,6 +65,7 @@ const OID_LOOKUP_CHUNK_ID: ChunkId = *b"OIDL"; · 45 unmodified lines | ||
| 63 | 65 | const SENTINEL_CHUNK_ID: ChunkId = [0u8; 4]; |
| 64 | 66 | |
| 65 | 67 | impl File { |
| 68 | + /// Try to parse the commit graph file at `path`. | |
| 66 | 69 | pub fn at(path: impl AsRef<Path>) -> Result<File, Error> { |
| 67 | 70 | Self::try_from(path.as_ref()) |
| 68 | 71 | } |