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

Method search

src/ghstack/diff.py:43–60  ·  view source on GitHub ↗
(s: str, github_url: str)

Source from the content-addressed store, hash-verified

41
42 @staticmethod
43 def search(s: str, github_url: str) -> Optional["PullRequestResolved"]:
44 m = re_pull_request_resolved(github_url).search(s)
45 if m is not None:
46 return PullRequestResolved(
47 owner=m.group("owner"),
48 repo=m.group("repo"),
49 number=GitHubNumber(int(m.group("number"))),
50 github_url=github_url,
51 )
52 m = RE_GH_METADATA.search(s)
53 if m is not None:
54 return PullRequestResolved(
55 owner=m.group("owner"),
56 repo=m.group("repo"),
57 number=GitHubNumber(int(m.group("number"))),
58 github_url=github_url,
59 )
60 return None
61
62
63@dataclass

Callers 10

mainFunction · 0.80
elaborate_diffMethod · 0.80
_update_source_idMethod · 0.80
push_updatesMethod · 0.80
_search_groupMethod · 0.80
convert_headerFunction · 0.80
get_head_refMethod · 0.80

Calls 2

re_pull_request_resolvedFunction · 0.85
PullRequestResolvedClass · 0.85

Tested by

no test coverage detected