Skip to content

Commit 51a4301

Browse files
committed
fix: remove unused fetch-error variants
Note that it's a breaking change, but it's on top of a previous breaking change so folks would already have to update explicitly.
1 parent d22937f commit 51a4301

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

gix/src/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub mod collate {
123123
crate::remote::fetch::Error::PackThreads(_)
124124
| crate::remote::fetch::Error::PackIndexVersion(_)
125125
| crate::remote::fetch::Error::RemovePackKeepFile { .. }
126-
| crate::remote::fetch::Error::Negotiate(_),
126+
| crate::remote::fetch::Error::Fetch(gix_protocol::fetch::Error::Negotiate(_)),
127127
) => true,
128128
_ => false,
129129
}

gix/src/remote/connection/fetch/error.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ pub enum Error {
1111
PackThreads(#[from] config::unsigned_integer::Error),
1212
#[error("The value to configure the pack index version should be 1 or 2")]
1313
PackIndexVersion(#[from] config::key::GenericError),
14-
#[error("Could not decode server reply")]
15-
FetchResponse(#[from] gix_protocol::fetch::response::Error),
1614
#[error("Cannot fetch from a remote that uses {remote} while local repository uses {local} for object hashes")]
1715
IncompatibleObjectHash {
1816
local: gix_hash::Kind,
@@ -21,48 +19,29 @@ pub enum Error {
2119
#[error(transparent)]
2220
LoadAlternates(#[from] gix_odb::store::load_index::Error),
2321
#[error(transparent)]
24-
Negotiate(#[from] gix_protocol::fetch::negotiate::Error),
25-
#[error(transparent)]
2622
Client(#[from] gix_protocol::transport::client::Error),
2723
#[error(transparent)]
28-
WritePack(#[from] gix_pack::bundle::write::Error),
29-
#[error(transparent)]
3024
UpdateRefs(#[from] super::refs::update::Error),
3125
#[error("Failed to remove .keep file at \"{}\"", path.display())]
3226
RemovePackKeepFile {
3327
path: std::path::PathBuf,
3428
source: std::io::Error,
3529
},
36-
#[error(transparent)]
37-
ShallowOpen(#[from] crate::shallow::read::Error),
38-
#[error("Server lack feature {feature:?}: {description}")]
39-
MissingServerFeature {
40-
feature: &'static str,
41-
description: &'static str,
42-
},
4330
#[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(", "))]
4431
NoMapping {
4532
refspecs: Vec<gix_refspec::RefSpec>,
4633
num_remote_refs: usize,
4734
},
48-
#[error("Could not write 'shallow' file to incorporate remote updates after fetching")]
49-
WriteShallowFile(#[from] crate::shallow::write::Error),
50-
#[error("'shallow' file could not be locked in preparation for writing changes")]
51-
LockShallowFile(#[from] gix_lock::acquire::Error),
5235
#[error("Could not obtain configuration to learn if shallow remotes should be rejected")]
5336
RejectShallowRemoteConfig(#[from] config::boolean::Error),
54-
#[error("Receiving objects from shallow remotes is prohibited due to the value of `clone.rejectShallow`")]
55-
RejectShallowRemote,
5637
#[error(transparent)]
5738
NegotiationAlgorithmConfig(#[from] config::key::GenericErrorWithValue),
58-
#[error("Failed to read remaining bytes in stream")]
59-
ReadRemainingBytes(#[source] std::io::Error),
6039
}
6140

6241
impl gix_protocol::transport::IsSpuriousError for Error {
6342
fn is_spurious(&self) -> bool {
6443
match self {
65-
Error::FetchResponse(err) => err.is_spurious(),
44+
Error::Fetch(err) => err.is_spurious(),
6645
Error::Client(err) => err.is_spurious(),
6746
_ => false,
6847
}

0 commit comments

Comments
 (0)