Skip to main content

normalize_git_url

Function normalize_git_url 

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

Normalize a git remote URL to a canonical short form.

Converts common hosting URLs to compact identifiers:

  • git@github.com:org/repo.git -> github:org/repo
  • https://github.com/org/repo.git -> github:org/repo
  • git@gitlab.com:org/repo.git -> gitlab:org/repo
  • https://gitlab.com/org/repo.git -> gitlab:org/repo