MCPcopy Create free account
hub / github.com/ezyang/ghstack / _normalize_remote_url

Function _normalize_remote_url

src/ghstack/github_utils.py:143–149  ·  view source on GitHub ↗

Convert SSH remote URL to HTTPS format, strip .git suffix.

(remote_url: str)

Source from the content-addressed store, hash-verified

141
142
143def _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
152def parse_pull_request(

Callers 1

parse_pull_requestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected