MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / compare

Method compare

github/Repository.py:1372–1387  ·  view source on GitHub ↗

:calls: `GET /repos/{owner}/{repo}/compare/{basehead} `_ :param base: string :param head: string :param comparison_commits_per_page: int Number of commits retrieved with the comparison. Iterating ov

(self, base: str, head: str, *, comparison_commits_per_page: int | None = None)

Source from the content-addressed store, hash-verified

1370 headers, data = self._requester.requestJsonAndCheck("DELETE", f"{self.url}/invitations/{invite_id}")
1371
1372 def compare(self, base: str, head: str, *, comparison_commits_per_page: int | None = None) -> Comparison:
1373 """
1374 :calls: `GET /repos/{owner}/{repo}/compare/{basehead} <https://docs.github.com/en/rest/commits/commits#compare-two-commits>`_
1375 :param base: string
1376 :param head: string
1377 :param comparison_commits_per_page: int Number of commits retrieved with the comparison. Iterating over the commits property will fetch pages of this size. The default page size is 250, the maximum is 1000. At most 10000 commits can be retrieved.
1378 :rtype: :class:`github.Comparison.Comparison`
1379 """
1380 assert isinstance(base, str), base
1381 assert isinstance(head, str), head
1382 # comparison_commits_per_page asserted in Commit(CompletableGithubObjectWithPaginatedProperty)
1383 base = urllib.parse.quote(base)
1384 head = urllib.parse.quote(head)
1385 return github.Comparison.Comparison(
1386 self._requester, url=f"{self.url}/compare/{base}...{head}", per_page=comparison_commits_per_page
1387 )
1388
1389 def create_autolink(
1390 self, key_prefix: str, url_template: str, is_alphanumeric: Opt[bool] = NotSet

Calls

no outgoing calls

Tested by

no test coverage detected