-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ impl Git { | |
Ok(()) | ||
} | ||
pub(crate) fn ssh_clone(url: &Url, working_dir: &Path, branch: Option<&str>) -> Result<()> { | ||
let ssh_url = GitHub::convert_to_shh_url(url); | ||
let ssh_url = GitHub::convert_to_ssh_url(url); | ||
if !working_dir.exists() { | ||
// Prepare callback and fetch options. | ||
let mut fo = FetchOptions::new(); | ||
|
@@ -84,7 +84,7 @@ impl Git { | |
|
||
/// For users that have ssh configuration for cloning repositories | ||
fn ssh_clone_and_degit(url: Url, target: &Path) -> Result<Repository> { | ||
let ssh_url = GitHub::convert_to_shh_url(&url); | ||
let ssh_url = GitHub::convert_to_ssh_url(&url); | ||
// Prepare callback and fetch options. | ||
let mut fo = FetchOptions::new(); | ||
Self::set_up_ssh_fetch_options(&mut fo)?; | ||
|
@@ -219,7 +219,7 @@ impl GitHub { | |
pub(crate) fn release(repo: &Url, tag: &str, artifact: &str) -> String { | ||
format!("{}/releases/download/{tag}/{artifact}", repo.as_str()) | ||
} | ||
pub(crate) fn convert_to_shh_url(url: &Url) -> String { | ||
pub(crate) fn convert_to_ssh_url(url: &Url) -> String { | ||
format!("git@{}:{}.git", url.host_str().unwrap_or(Self::GITHUB), &url.path()[1..]) | ||
} | ||
} | ||
|
@@ -237,23 +237,23 @@ mod tests { | |
use super::*; | ||
|
||
#[test] | ||
fn test_convert_to_shh_url() { | ||
fn test_convert_to_ssh_url() { | ||
assert_eq!( | ||
GitHub::convert_to_shh_url( | ||
GitHub::convert_to_ssh_url( | ||
&Url::parse("https://github.com/r0gue-io/base-parachain") | ||
.expect("valid repository url") | ||
), | ||
"[email protected]:r0gue-io/base-parachain.git" | ||
); | ||
assert_eq!( | ||
GitHub::convert_to_shh_url( | ||
GitHub::convert_to_ssh_url( | ||
&Url::parse("https://github.com/paritytech/substrate-contracts-node") | ||
.expect("valid repository url") | ||
), | ||
"[email protected]:paritytech/substrate-contracts-node.git" | ||
); | ||
assert_eq!( | ||
GitHub::convert_to_shh_url( | ||
GitHub::convert_to_ssh_url( | ||
&Url::parse("https://github.com/paritytech/frontier-parachain-template") | ||
.expect("valid repository url") | ||
), | ||
|