diff options
Diffstat (limited to 'vendor/gix/src/commit.rs')
-rw-r--r-- | vendor/gix/src/commit.rs | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/vendor/gix/src/commit.rs b/vendor/gix/src/commit.rs index a58954a36..68e1eeba7 100644 --- a/vendor/gix/src/commit.rs +++ b/vendor/gix/src/commit.rs @@ -31,7 +31,7 @@ pub mod describe { use crate::{bstr::BStr, ext::ObjectIdExt, Repository}; - /// The result of [try_resolve()][Platform::try_resolve()]. + /// The result of [`try_resolve()`][Platform::try_resolve()]. pub struct Resolution<'repo> { /// The outcome of the describe operation. pub outcome: gix_revision::describe::Outcome<'static>, @@ -47,12 +47,12 @@ pub mod describe { } } - /// The error returned by [try_format()][Platform::try_format()]. + /// The error returned by [`try_format()`][Platform::try_format()]. #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] pub enum Error { #[error(transparent)] - Describe(#[from] gix_revision::describe::Error<gix_odb::store::find::Error>), + Describe(#[from] gix_revision::describe::Error), #[error("Could not produce an unambiguous shortened id for formatting.")] ShortId(#[from] crate::id::shorten::Error), #[error(transparent)] @@ -201,15 +201,18 @@ pub mod describe { /// to save ~40% of time. pub fn try_resolve(&self) -> Result<Option<Resolution<'repo>>, Error> { // TODO: dirty suffix with respective dirty-detection - let outcome = gix_revision::describe( - &self.id, + let mut graph = gix_revision::Graph::new( |id, buf| { - Ok(self - .repo + self.repo .objects - .try_find(id, buf)? - .and_then(|d| d.try_into_commit_iter())) + .try_find(id, buf) + .map(|r| r.and_then(|d| d.try_into_commit_iter())) }, + gix_commitgraph::Graph::from_info_dir(self.repo.objects.store_ref().path().join("info")).ok(), + ); + let outcome = gix_revision::describe( + &self.id, + &mut graph, gix_revision::describe::Options { name_by_oid: self.select.names(self.repo)?, fallback_to_oid: self.id_as_fallback, @@ -218,7 +221,7 @@ pub mod describe { }, )?; - Ok(outcome.map(|outcome| crate::commit::describe::Resolution { + Ok(outcome.map(|outcome| Resolution { outcome, id: self.id.attach(self.repo), })) |