Fixing a counter-intuitive error when a local repo does not exist
Dependencies
- [2]
IVLLXQ5ZImproved push/pull reporting - [3]
A3RM526YIntegrating identity malleability - [4]
YN63NUZOSanakirja 1.0 - [5]
IRTYN5FFRemove duplicated line in remote/mod.rs - [6]
JACZYXK4Fixing a bug in unrecord - [7]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [8]
76PCXGMLPushing to, and pulling from the local repository - [9]
FE5ES6Q4Stop pushing/pulling if the remote returns an error - [10]
GYXIF25TProper parsing of URLs - [11]
EEBKW7VTKeys and identities - [12]
SZWBLWZ4Reading ~/.ssh/config - [13]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [14]
ZSFJT4SFAllow remotes to have a different push and pull address - [15]
KVCXCDRMFixing warnings with Rust 1.57 + cleanup - [16]
UDHP4ZVBFixing SSH asynchronicity issues
Change contents
- replacement in pijul/src/remote/ssh.rs at line 88
pub async fn connect(&mut self, name: &str, channel: &str) -> Result<Ssh, anyhow::Error> {pub async fn connect(&mut self,name: &str,channel: &str,) -> Result<Option<Ssh>, anyhow::Error> { - replacement in pijul/src/remote/ssh.rs at line 106
let stream = self.config.stream().await?;let stream = match self.config.stream().await {Ok(stream) => stream,Err(e) => {info!("remote connect error: {:?}", e);return Ok(None);}}; - replacement in pijul/src/remote/ssh.rs at line 137
Ok(Ssh {Ok(Some(Ssh { - replacement in pijul/src/remote/ssh.rs at line 147
})})) - replacement in pijul/src/remote/mod.rs at line 82
return if let Some(mut ssh) = ssh_remote(name, with_path) {if let Some(mut ssh) = ssh_remote(name, with_path) { - replacement in pijul/src/remote/mod.rs at line 84
Ok(RemoteRepo::Ssh(ssh.connect(name, channel).await?))} else {bail!("Remote not found: {:?}", name)};if let Some(c) = ssh.connect(name, channel).await? {return Ok(RemoteRepo::Ssh(c));}}bail!("Remote not found: {:?}", name) - replacement in pijul/src/remote/mod.rs at line 106[3.54479]→[3.7031:7129](∅→∅),[3.7129]→[3.54566:54603](∅→∅),[3.54566]→[3.54566:54603](∅→∅),[3.54603]→[3.724:772](∅→∅),[3.772]→[3.0:53](∅→∅),[3.53]→[3.54644:54719](∅→∅),[3.772]→[3.54644:54719](∅→∅),[3.54644]→[3.54644:54719](∅→∅),[3.54719]→[3.10385:10431](∅→∅),[3.54798]→[3.54798:54838](∅→∅),[3.54838]→[3.773:790](∅→∅)
if let Ok(pristine) = libpijul::pristine::sanakirja::Pristine::new(&dot_dir.join("db")) {debug!("pristine done");return Ok(RemoteRepo::Local(Local {root: Path::new(name).to_path_buf(),channel: channel.to_string(),changes_dir,pristine: Arc::new(pristine),name: name.to_string(),}));match libpijul::pristine::sanakirja::Pristine::new(&dot_dir.join("db")) {Ok(pristine) => {debug!("pristine done");return Ok(RemoteRepo::Local(Local {root: Path::new(name).to_path_buf(),channel: channel.to_string(),changes_dir,pristine: Arc::new(pristine),name: name.to_string(),}));}Err(libpijul::pristine::sanakirja::SanakirjaError::Sanakirja(sanakirja::Error::IO(e),)) if e.kind() == std::io::ErrorKind::NotFound => {debug!("repo not found")}Err(e) => return Err(e.into()), - replacement in pijul/src/remote/mod.rs at line 127
Ok(RemoteRepo::Ssh(ssh.connect(name, channel).await?))} else {bail!("Remote not found: {:?}", name)if let Some(c) = ssh.connect(name, channel).await? {return Ok(RemoteRepo::Ssh(c));} - edit in pijul/src/remote/mod.rs at line 131
bail!("Remote not found: {:?}", name) - replacement in pijul/src/commands/key.rs at line 110
ssh.connect(&remote, crate::DEFAULT_CHANNEL).await?if let Some(c) = ssh.connect(&remote, crate::DEFAULT_CHANNEL).await? {c} else {bail!("No such remote: {}", remote)}