From 5467b40b2e9485e23dcfc57930dfcdc88b230bbb Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Thu, 23 Feb 2023 07:22:32 +0000 Subject: [PATCH] fix to git clone splice --- lib/helpers/src/git.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/helpers/src/git.rs b/lib/helpers/src/git.rs index 3ab8c52c2..7d2429c89 100644 --- a/lib/helpers/src/git.rs +++ b/lib/helpers/src/git.rs @@ -83,7 +83,7 @@ async fn clone( access_token: Option, ) -> Log { let _ = std::fs::remove_dir_all(destination); - let access_token = match access_token { + let access_token_at = match &access_token { Some(token) => format!("{token}@"), None => String::new(), }; @@ -91,12 +91,12 @@ async fn clone( Some(branch) => format!(" -b {branch}"), None => String::new(), }; - let repo_url = format!("https://{access_token}github.com/{repo}.git"); + let repo_url = format!("https://{access_token_at}github.com/{repo}.git"); let command = format!("git clone {repo_url} {destination}{branch}"); let start_ts = monitor_timestamp(); let output = async_run_command(&command).await; - let command = if access_token.len() > 0 { - command.replace(&access_token, "") + let command = if access_token_at.len() > 0 { + command.replace(&access_token.unwrap(), "") } else { command };