Skip to content

various post-release improvements #1740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gix/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub mod collate {
crate::remote::fetch::Error::PackThreads(_)
| crate::remote::fetch::Error::PackIndexVersion(_)
| crate::remote::fetch::Error::RemovePackKeepFile { .. }
| crate::remote::fetch::Error::Negotiate(_),
| crate::remote::fetch::Error::Fetch(gix_protocol::fetch::Error::Negotiate(_)),
) => true,
_ => false,
}
Expand Down
23 changes: 1 addition & 22 deletions gix/src/remote/connection/fetch/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ pub enum Error {
PackThreads(#[from] config::unsigned_integer::Error),
#[error("The value to configure the pack index version should be 1 or 2")]
PackIndexVersion(#[from] config::key::GenericError),
#[error("Could not decode server reply")]
FetchResponse(#[from] gix_protocol::fetch::response::Error),
#[error("Cannot fetch from a remote that uses {remote} while local repository uses {local} for object hashes")]
IncompatibleObjectHash {
local: gix_hash::Kind,
Expand All @@ -21,48 +19,29 @@ pub enum Error {
#[error(transparent)]
LoadAlternates(#[from] gix_odb::store::load_index::Error),
#[error(transparent)]
Negotiate(#[from] gix_protocol::fetch::negotiate::Error),
#[error(transparent)]
Client(#[from] gix_protocol::transport::client::Error),
#[error(transparent)]
WritePack(#[from] gix_pack::bundle::write::Error),
#[error(transparent)]
UpdateRefs(#[from] super::refs::update::Error),
#[error("Failed to remove .keep file at \"{}\"", path.display())]
RemovePackKeepFile {
path: std::path::PathBuf,
source: std::io::Error,
},
#[error(transparent)]
ShallowOpen(#[from] crate::shallow::read::Error),
#[error("Server lack feature {feature:?}: {description}")]
MissingServerFeature {
feature: &'static str,
description: &'static str,
},
#[error("None of the refspec(s) {} matched any of the {num_remote_refs} refs on the remote", refspecs.iter().map(|r| r.to_ref().instruction().to_bstring().to_string()).collect::<Vec<_>>().join(", "))]
NoMapping {
refspecs: Vec<gix_refspec::RefSpec>,
num_remote_refs: usize,
},
#[error("Could not write 'shallow' file to incorporate remote updates after fetching")]
WriteShallowFile(#[from] crate::shallow::write::Error),
#[error("'shallow' file could not be locked in preparation for writing changes")]
LockShallowFile(#[from] gix_lock::acquire::Error),
#[error("Could not obtain configuration to learn if shallow remotes should be rejected")]
RejectShallowRemoteConfig(#[from] config::boolean::Error),
#[error("Receiving objects from shallow remotes is prohibited due to the value of `clone.rejectShallow`")]
RejectShallowRemote,
#[error(transparent)]
NegotiationAlgorithmConfig(#[from] config::key::GenericErrorWithValue),
#[error("Failed to read remaining bytes in stream")]
ReadRemainingBytes(#[source] std::io::Error),
}

impl gix_protocol::transport::IsSpuriousError for Error {
fn is_spurious(&self) -> bool {
match self {
Error::FetchResponse(err) => err.is_spurious(),
Error::Fetch(err) => err.is_spurious(),
Error::Client(err) => err.is_spurious(),
_ => false,
}
Expand Down
Loading