This commit is contained in:
Michael Sloan 2025-08-04 16:06:45 +00:00 committed by GitHub
parent d577ef52cb
commit 3ff42dd8c2
403 changed files with 8398 additions and 24176 deletions

View file

@ -159,11 +159,7 @@ impl GitHostingProvider for Github {
}
let mut path_segments = url.path_segments()?;
let mut owner = path_segments.next()?;
if owner.is_empty() {
owner = path_segments.next()?;
}
let owner = path_segments.next()?;
let repo = path_segments.next()?.trim_end_matches(".git");
Some(ParsedGitRemote {
@ -248,22 +244,6 @@ mod tests {
use super::*;
#[test]
fn test_remote_url_with_root_slash() {
let remote_url = "git@github.com:/zed-industries/zed";
let parsed_remote = Github::public_instance()
.parse_remote_url(remote_url)
.unwrap();
assert_eq!(
parsed_remote,
ParsedGitRemote {
owner: "zed-industries".into(),
repo: "zed".into(),
}
);
}
#[test]
fn test_invalid_self_hosted_remote_url() {
let remote_url = "git@github.com:zed-industries/zed.git";