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

Method get_branch

github/Repository.py:2307–2316  ·  view source on GitHub ↗

:calls: `GET /repos/{owner}/{repo}/branches/{branch} `_ :param branch: string :rtype: :class:`github.Branch.Branch`

(self, branch: str)

Source from the content-addressed store, hash-verified

2305 return PaginatedList(github.NamedUser.NamedUser, self._requester, f"{self.url}/assignees", None)
2306
2307 def get_branch(self, branch: str) -> Branch:
2308 """
2309 :calls: `GET /repos/{owner}/{repo}/branches/{branch} <https://docs.github.com/en/rest/reference/repos#get-a-branch>`_
2310 :param branch: string
2311 :rtype: :class:`github.Branch.Branch`
2312 """
2313 assert isinstance(branch, str), branch
2314 branch = urllib.parse.quote(branch)
2315 headers, data = self._requester.requestJsonAndCheck("GET", f"{self.url}/branches/{branch}")
2316 return github.Branch.Branch(self._requester, headers, data)
2317
2318 def rename_branch(self, branch: str | Branch, new_name: str) -> bool:
2319 """

Callers 15

testAllClassesMethod · 0.80
setUpMethod · 0.80
testBranchEqualityMethod · 0.80
testDeleteOnMergeMethod · 0.80
testRestoreBranchMethod · 0.80
testDeleteBranchMethod · 0.80
testForceDeleteBranchMethod · 0.80
setUpMethod · 0.80

Calls 1

requestJsonAndCheckMethod · 0.80

Tested by 1