parse_git_remote_url

Function parse_git_remote_url 

Source
pub fn parse_git_remote_url(url: &str) -> Result<String, String>
Expand description

Parses a git remote URL to extract owner/repo.

Supports SSH (git@github.com:owner/repo.git) and HTTPS (https://github.com/owner/repo.git) formats.

ยงExamples

use aptu_core::utils::parse_git_remote_url;

assert_eq!(parse_git_remote_url("git@github.com:owner/repo.git"), Ok("owner/repo".to_string()));
assert_eq!(parse_git_remote_url("https://github.com/owner/repo.git"), Ok("owner/repo".to_string()));
assert_eq!(parse_git_remote_url("git@github.com:owner/repo"), Ok("owner/repo".to_string()));