radicle-fetch: Fallback to known version
There's a good chance that gix can just keep going in this case.
This commit is contained in:
parent
a670b6e668
commit
d2517c5004
|
|
@ -327,9 +327,15 @@ impl WantsHaves {
|
|||
}
|
||||
}
|
||||
|
||||
fn agent_name() -> io::Result<String> {
|
||||
Ok(format!(
|
||||
"git/{}",
|
||||
radicle::git::version().map_err(io_other)?
|
||||
))
|
||||
fn agent_name() -> String {
|
||||
let version = match radicle::git::version() {
|
||||
Ok(version) => version,
|
||||
Err(err) => {
|
||||
use radicle::git::VERSION_REQUIRED;
|
||||
log::warn!(target: "fetch", "The git version could not be determined: {err}");
|
||||
log::warn!(target: "fetch", "Pretending that we are on git version {VERSION_REQUIRED}.");
|
||||
VERSION_REQUIRED
|
||||
}
|
||||
};
|
||||
format!("git/{version}")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ where
|
|||
keepfile: None,
|
||||
};
|
||||
let mut negotiate = Negotiate { wants_haves };
|
||||
let agent = agent_name().map_err(Error::ReadRemainingBytes)?;
|
||||
let agent = agent_name();
|
||||
|
||||
let mut pack_out = None;
|
||||
let mut handshake = handshake.clone();
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ where
|
|||
arg.push_str(prefix);
|
||||
args.push(arg)
|
||||
}
|
||||
features.push(("agent", Some(Cow::Owned(agent_name()?))));
|
||||
features.push(("agent", Some(Cow::Owned(agent_name()))));
|
||||
Ok(gix_protocol::ls_refs::Action::Continue)
|
||||
},
|
||||
progress,
|
||||
|
|
|
|||
Loading…
Reference in New Issue