MCPcopy Create free account
hub / github.com/deepelementlab/jupyter-studio / parse_pr_ref

Function parse_pr_ref

clawcode/clawcode/integrations/github_pr.py:64–78  ·  view source on GitHub ↗

Parse owner/repo/number from URL in tail, or number-only (needs remote).

(tail: str)

Source from the content-addressed store, hash-verified

62
63
64def parse_pr_ref(tail: str) -> PrRef | None:
65 """Parse owner/repo/number from URL in tail, or number-only (needs remote)."""
66 t = (tail or "").strip()
67 if not t:
68 return None
69 m = _PR_URL.search(t)
70 if m:
71 return PrRef(
72 owner=m.group("owner"),
73 repo=_strip_git_suffix(m.group("repo")),
74 number=int(m.group("num")),
75 )
76 if t.isdigit():
77 return None # caller combines with RepoRef from git
78 return None
79
80
81def parse_remote_url(remote_url: str) -> RepoRef | None:

Callers 1

resolve_pr_refFunction · 0.85

Calls 3

PrRefClass · 0.85
_strip_git_suffixFunction · 0.85
searchMethod · 0.45

Tested by

no test coverage detected