Skip to main content

normalize_git_url

Function normalize_git_url 

Source
pub fn normalize_git_url(raw: &str) -> String
Expand description

Convert a repository browse URL into a clonable git URL.

Handles Bitbucket Server/Data Center (/projects/{PROJ}/repos/{REPO}/...), GitLab (/path/repo/-/tree/...), GitHub (github.com/{owner}/{repo}/tree/...), and Bitbucket Cloud (bitbucket.org/{ws}/{repo}/src/...). SSH URLs and URLs that already look like clone targets are returned unchanged.