Skip to main content

split_repo

Function split_repo 

Source
pub fn split_repo(s: &str) -> Option<(String, String)>
Expand description

Parse a git remote URL or bare slug into (owner, repo). Handles “owner/repo”, “https://github.com/owner/repo(.git)”, “ssh://[user@]host/owner/repo(.git)”, and scp-like SSH syntax “[user@]host:owner/repo(.git)” — including a custom ssh config host alias (e.g. git@github.com-work:owner/repo.git), which multi-remote setups (a personal origin alongside an internal mirror reached via an aliased SSH host) rely on and which a fixed github.com prefix can’t recognize.