Skip to content
This repository was archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #94 from bloom1/bloom1/allow-ssh-urls
Browse files Browse the repository at this point in the history
Allow ssh:// URL
  • Loading branch information
mergify[bot] authored Feb 24, 2020
2 parents 8638e87 + 998eded commit 95b621f
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions git_pull_request/__init__.py
Original file line number Diff line number Diff line change
@@ -184,6 +184,8 @@ def get_hosttype_hostname_user_repo_from_url(url):
else:
path = parsed.path[1:].rstrip('/')
host = parsed.netloc
if "@" in host:
username, sep, host = host.partition("@")
hosttype = get_hosttype(host)
if hosttype == "pagure":
user, repo = None, path
4 changes: 4 additions & 0 deletions git_pull_request/tests/test_gpr.py
Original file line number Diff line number Diff line change
@@ -73,6 +73,10 @@ def test_get_hosttype_user_repo_from_url(self):
("github", "example.com", "jd", "git-pull-request"),
gpr.get_hosttype_hostname_user_repo_from_url(
"https://example.com/jd/git-pull-request"))
self.assertEqual(
("github", "example.com:2222", "jd", "git-pull-request"),
gpr.get_hosttype_hostname_user_repo_from_url(
"ssh://git@example.com:2222/jd/git-pull-request"))
gpr.git_set_config_hosttype("pagure")
self.assertEqual(
("pagure", "pagure.io", None, "pagure"),

0 comments on commit 95b621f

Please sign in to comment.