sibling of 899bc8a8fd
This commit is contained in:
parent
d577ef52cb
commit
3ff42dd8c2
403 changed files with 8398 additions and 24176 deletions
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue