Skip to content

Commit

Permalink
pygit2: apply any URL rewrite rules before checking for supported
Browse files Browse the repository at this point in the history
remote protocol
  • Loading branch information
pmrowla committed Jan 29, 2024
1 parent c924431 commit af6500e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/scmrepo/git/backend/pygit2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,13 +646,13 @@ def _get_remote(self, url: str) -> Generator["Remote", None, None]:
except KeyError as exc:
raise SCMError(f"'{url}' is not a valid Git remote or URL") from exc

parsed = urlparse(url)
if parsed.scheme in ("git", "git+ssh", "ssh") or url.startswith("git@"):
raise NotImplementedError
if os.name == "nt" and url.startswith("file://"):
url = url[len("file://") :]

yield self.repo.remotes.create_anonymous(url)
remote = self.repo.remotes.create_anonymous(url)
parsed = urlparse(remote.url)
if parsed.scheme in ("git", "git+ssh", "ssh") or url.startswith("git@"):
raise NotImplementedError
yield remote

def fetch_refspecs(
self,
Expand Down

0 comments on commit af6500e

Please sign in to comment.