Skip to content

Commit

Permalink
fix: Correctly parse Git SSH urls (#53)
Browse files Browse the repository at this point in the history
fix: Correctly parse Git SSH urls
  • Loading branch information
vyfor authored May 25, 2024
2 parents 50f147f + 7925b31 commit c366ac0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/util/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,10 @@ fn find_git_repository(workspace_path: &str) -> Option<String> {
);
} else if let Some((_protocol, repo_url)) = repo_url.split_once('@')
{
let repo_url = repo_url.replacen(':', "/", 1);
return Some(format!(
"https://{}",
repo_url
.replacen(':', "/", 1)
.strip_suffix(".git")
.unwrap_or(repo_url)
repo_url.strip_suffix(".git").unwrap_or(&repo_url)
));
}
break;
Expand Down

0 comments on commit c366ac0

Please sign in to comment.