pijul-clone: avoid panics on parsing remote URLs
[?]
Jan 12, 2021, 6:15 PM
5XMUEZMZXQ4T4HGZAGBZWT5YKEXOA7IWLZBSREWBHXLMGHXOFXZACDependencies
- [2]
MU5GSJAWPartial push and pull (WARNING: breaks the existing protocol) - [3]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [4]
L4JXJHWXpijul/*: reorganize imports and remove extern crate - [5]
I52XSRUHMassive cleanup, and simplification - [6]
UDHP4ZVBFixing SSH asynchronicity issues - [7]
5QTMRUXNFixing a race condition between progress bars - [8]
76PCXGMLPushing to, and pulling from the local repository
Change contents
- replacement in pijul/src/remote/mod.rs at line 5
use anyhow::bail;use anyhow::{bail, Context}; - replacement in pijul/src/remote/mod.rs at line 121
pub fn repo_name(&self) -> Option<String> {pub fn repo_name(&self) -> Result<Option<String>, anyhow::Error> { - replacement in pijul/src/remote/mod.rs at line 125
Some(s.name.split_at(sep + 1).1.to_string())Ok(Some(s.name.split_at(sep + 1).1.to_string())) - replacement in pijul/src/remote/mod.rs at line 127
Some(s.name.as_str().to_string())Ok(Some(s.name.as_str().to_string())) - replacement in pijul/src/remote/mod.rs at line 132
Some(file.to_str().unwrap().to_string())Ok(Some(file.to_str().context("failed to decode local repository name")?.to_string(),)) - replacement in pijul/src/remote/mod.rs at line 138
NoneOk(None) - replacement in pijul/src/remote/mod.rs at line 142
let url = reqwest::Url::parse(&h.url).unwrap();let url =reqwest::Url::parse(&h.url).context("failed to parse remote repository URL")?; - replacement in pijul/src/remote/mod.rs at line 145
Some(name.to_string())Ok(Some(name.to_string())) - replacement in pijul/src/remote/mod.rs at line 147
url.host().map(|h| h.to_string())Ok(url.host().map(|h| h.to_string())) - replacement in pijul/src/remote/mod.rs at line 150
RemoteRepo::LocalChannel(_) => None,RemoteRepo::LocalChannel(_) => Ok(None), - replacement in pijul/src/commands/clone.rs at line 51
} else if let Some(path) = remote.repo_name() {} else if let Some(path) = remote.repo_name()? {