From fd2593cc1e5824687f3bcc4be4badc3d7920e5fc Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 6 Jun 2023 19:25:22 +0200 Subject: [PATCH 1/2] fix: avoid duplicate error message "There was an error looking up a commit" could be printed twice in error stacks due to a copy-paste error. --- gix-revision/src/graph/errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gix-revision/src/graph/errors.rs b/gix-revision/src/graph/errors.rs index fd893c98573..a2d849fbf43 100644 --- a/gix-revision/src/graph/errors.rs +++ b/gix-revision/src/graph/errors.rs @@ -14,7 +14,7 @@ pub mod lookup { #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] pub enum Error { - #[error("There was an error looking up a commit")] + #[error(transparent)] Find(#[from] crate::graph::lookup::Error), #[error(transparent)] ToOwned(#[from] crate::graph::commit::to_owned::Error), From 9010f586ac46fcea5b8abba8f30a5639ed6b9225 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 6 Jun 2023 19:43:00 +0200 Subject: [PATCH 2/2] fix: `gix::env::fetch::collate::Error` now considers negotiation errors a sign of corrupt git repos. Indeed, all of these negotiation errors are due to failures reading references or objects that ought to be there. --- gix/src/env.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gix/src/env.rs b/gix/src/env.rs index 07c06cc2b62..ce5461bcc33 100644 --- a/gix/src/env.rs +++ b/gix/src/env.rs @@ -119,7 +119,8 @@ pub mod collate { Error::Fetch( crate::remote::fetch::Error::PackThreads(_) | crate::remote::fetch::Error::PackIndexVersion(_) - | crate::remote::fetch::Error::RemovePackKeepFile { .. }, + | crate::remote::fetch::Error::RemovePackKeepFile { .. } + | crate::remote::fetch::Error::Negotiate(_), ) => true, _ => false, }