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

Method get_git_tree

github/Repository.py:3092–3109  ·  view source on GitHub ↗

:calls: `GET /repos/{owner}/{repo}/git/trees/{tree_sha} `_ :param sha: string :param recursive: bool :rtype: :class:`github.GitTree.GitTree`

(self, sha: str, recursive: Opt[bool] = NotSet)

Source from the content-addressed store, hash-verified

3090 return github.GitTag.GitTag(self._requester, headers, data, completed=True)
3091
3092 def get_git_tree(self, sha: str, recursive: Opt[bool] = NotSet) -> GitTree:
3093 """
3094 :calls: `GET /repos/{owner}/{repo}/git/trees/{tree_sha} <https://docs.github.com/en/rest/reference/git#trees>`_
3095 :param sha: string
3096 :param recursive: bool
3097 :rtype: :class:`github.GitTree.GitTree`
3098 """
3099 assert isinstance(sha, str), sha
3100 assert is_optional(recursive, bool), recursive
3101 sha = urllib.parse.quote(sha, safe="")
3102 url_parameters = dict()
3103 if is_defined(recursive) and recursive:
3104 # GitHub API requires the recursive parameter be set to 1.
3105 url_parameters["recursive"] = 1
3106 headers, data = self._requester.requestJsonAndCheck(
3107 "GET", f"{self.url}/git/trees/{sha}", parameters=url_parameters
3108 )
3109 return github.GitTree.GitTree(self._requester, headers, data, completed=True)
3110
3111 def get_hook(self, id: int) -> Hook:
3112 """

Callers 7

testAllClassesMethod · 0.80
setUpMethod · 0.80
testCreateGitCommitMethod · 0.80

Calls 3

is_optionalFunction · 0.90
is_definedFunction · 0.90
requestJsonAndCheckMethod · 0.80

Tested by

no test coverage detected