From 88af68f7b0e55ab3c5952eb1a0e034a158acd598 Mon Sep 17 00:00:00 2001 From: Ricky Date: Fri, 31 Jan 2020 12:49:16 +0100 Subject: [PATCH] Checking for ssh scheme before trying to set_scheme as https, this resulted in a return value of '()' and when creating a new workspace will fail --- src/cargo/util/canonical_url.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cargo/util/canonical_url.rs b/src/cargo/util/canonical_url.rs index df5d2c7f6cc..2b03b7a8e44 100644 --- a/src/cargo/util/canonical_url.rs +++ b/src/cargo/util/canonical_url.rs @@ -39,9 +39,14 @@ impl CanonicalUrl { // almost certainly not using the same case conversion rules that GitHub // does. (See issue #84) if url.host_str() == Some("github.com") { - url.set_scheme("https").unwrap(); - let path = url.path().to_lowercase(); - url.set_path(&path); + if url.scheme() == "ssh" { + let path = url.path().to_lowercase(); + url.set_path(&path); + } else { + url.set_scheme("https").unwrap(); + let path = url.path().to_lowercase(); + url.set_path(&path); + } } // Repos can generally be accessed with or without `.git` extension.