History

adapt to changes in `gix-commitgraph`

Sebastian Thiel committed 10 months ago

Commit 1f589051 parent 449bf5d11 files · +26 −24Browse files

Showing the changes to gitoxide-core/src/commitgraph (1 of 11 files). Show all

Unified · Split

gitoxide-core/src/commitgraph/verify.rs+6−8
@@ -22,10 +22,10 @@ impl Default for Context<Vec<u8>, Vec<u8>> { · 21 unmodified lines
2222 pub(crate) mod function {
2323 use std::{io, path::Path};
2424
25− use anyhow::{Context as AnyhowContext, Result};
26− use gix::commitgraph::{verify::Outcome, Graph};
27−
2825 use crate::OutputFormat;
26+ use anyhow::Result;
27+ use gix::commitgraph::{verify::Outcome, Graph};
28+ use gix::Exn;
2929
3030 pub fn verify<W1, W2>(
3131 path: impl AsRef<Path>,
@@ -34,20 +34,18 @@ pub(crate) mod function { · 2 unmodified lines
3434 mut out,
3535 output_statistics,
3636 }: super::Context<W1, W2>,
37− ) -> Result<gix::commitgraph::verify::Outcome>
37+ ) -> Result<Outcome>
3838 where
3939 W1: io::Write,
4040 W2: io::Write,
4141 {
42− let g = Graph::at(path.as_ref()).with_context(|| "Could not open commit graph")?;
42+ let g = Graph::at(path.as_ref()).map_err(Exn::into_error)?;
4343
4444 #[allow(clippy::unnecessary_wraps, unknown_lints)]
4545 fn noop_processor(_commit: &gix::commitgraph::file::Commit<'_>) -> std::result::Result<(), std::fmt::Error> {
4646 Ok(())
4747 }
48− let stats = g
49− .verify_integrity(noop_processor)
50− .with_context(|| "Verification failure")?;
48+ let stats = g.verify_integrity(noop_processor).map_err(Exn::into_error)?;
5149
5250 #[cfg_attr(not(feature = "serde"), allow(clippy::single_match))]
5351 match output_statistics {