Convert SSH remote URL to HTTPS format, strip .git suffix.
(remote_url: str)
| 141 | |
| 142 | |
| 143 | def _normalize_remote_url(remote_url: str) -> str: |
| 144 | """Convert SSH remote URL to HTTPS format, strip .git suffix.""" |
| 145 | # git@github.com:owner/repo.git -> https://github.com/owner/repo |
| 146 | m = re.match(r"^git@([^:]+):/?(.+?)(?:\.git)?$", remote_url) |
| 147 | if m: |
| 148 | return f"https://{m.group(1)}/{m.group(2)}" |
| 149 | return re.sub(r"\.git$", "", remote_url) |
| 150 | |
| 151 | |
| 152 | def parse_pull_request( |
no outgoing calls
no test coverage detected