diff --git a/src/run/helpers/parse_git_remote.rs b/src/run/helpers/parse_git_remote.rs index 579ecda9..42cb19e0 100644 --- a/src/run/helpers/parse_git_remote.rs +++ b/src/run/helpers/parse_git_remote.rs @@ -3,7 +3,7 @@ use lazy_static::lazy_static; lazy_static! { static ref REMOTE_REGEX: regex::Regex = regex::Regex::new( - r"(?P[^/@\.]+\.\w+)[:/](?P[^/]+)/(?P[^/]+?)(\.git)?$" + r"(?P[^/@\.]+\.\w+)[:/](?P[^/]+)/(?P[^/]+?)(\.git)?/?$" ) .unwrap(); } @@ -89,5 +89,15 @@ mod tests { repository: "runner", } "###); + + let remote = "https://github.com/codspeed/runner/"; + let git_remote = parse_git_remote(remote).unwrap(); + insta::assert_debug_snapshot!(git_remote, @r###" + GitRemote { + domain: "github.com", + owner: "codspeed", + repository: "runner", + } + "###); } }