Kill the surviving mutants of repos.py and url_beside
This commit is contained in:
@@ -18,11 +18,10 @@ def forge_of(origin_url: str) -> Forge:
|
||||
|
||||
|
||||
def url_beside(origin_url: str, name: str) -> str | None:
|
||||
"""The origin URL of the repo called name in the same place, host and owner, as origin_url's repo; None where origin_url has no place, such as a bare name. A trailing `.git` is dropped, since gh and tea clone without it."""
|
||||
trimmed = origin_url.rstrip("/").removesuffix(".git")
|
||||
place = re.fullmatch(r"(.+[/:])[^/:]+", trimmed)
|
||||
# A scheme's own `//` or `:` leaves no repo to put a name beside.
|
||||
return place.group(1) + name if place and not place.group(1).endswith("//") and not re.fullmatch(r"\w+:", place.group(1)) else None
|
||||
"""The origin URL of the repo called name in the same place, host and owner, as origin_url's repo; None where origin_url has no place, such as a bare name. The URL has no `.git`, since gh and tea clone without it."""
|
||||
place = re.fullmatch(r"(.+[/:])[^/:]+", origin_url.rstrip("/"))
|
||||
# A scheme's own `//` leaves no repo to put a name beside.
|
||||
return place.group(1) + name if place and not place.group(1).endswith("//") else None
|
||||
|
||||
|
||||
def runner(cwd: str) -> Run:
|
||||
|
||||
Reference in New Issue
Block a user