Unwrap upstream URL to prevent obscure panics

Signed-off-by: ATechnoHazard <amolele@gmail.com>
This commit is contained in:
ATechnoHazard 2020-10-19 01:55:17 +05:30
parent ed35930562
commit 7b3d457c62
No known key found for this signature in database
GPG key ID: F475143EDEDEBA3C
2 changed files with 20 additions and 5 deletions

View file

@ -37,11 +37,7 @@ fn main() -> anyhow::Result<()> {
if let Ok(remote) = repo.find_remote(
// This is a rather ugly hack, but not sure how else to get the required name
// doesn't seem to work with the full name such as `refs/remotes/origin/master`
upstream
.as_str()
.unwrap_or("None")
.split('/')
.collect::<Vec<&str>>()[2],
upstream.as_str().unwrap().split('/').collect::<Vec<&str>>()[2],
) {
let path = entry.path().to_string_lossy().to_string();
repos.insert(