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

Method create_git_ref

github/Repository.py:1461–1475  ·  view source on GitHub ↗

:calls: `POST /repos/{owner}/{repo}/git/refs `_ :param ref: string :param sha: string :rtype: :class:`github.GitRef.GitRef`

(self, ref: str, sha: str)

Source from the content-addressed store, hash-verified

1459 return github.GitCommit.GitCommit(self._requester, headers, data, completed=True)
1460
1461 def create_git_ref(self, ref: str, sha: str) -> GitRef:
1462 """
1463 :calls: `POST /repos/{owner}/{repo}/git/refs <https://docs.github.com/en/rest/reference/git#references>`_
1464 :param ref: string
1465 :param sha: string
1466 :rtype: :class:`github.GitRef.GitRef`
1467 """
1468 assert isinstance(ref, str), ref
1469 assert isinstance(sha, str), sha
1470 post_parameters = {
1471 "ref": ref,
1472 "sha": sha,
1473 }
1474 headers, data = self._requester.requestJsonAndCheck("POST", f"{self.url}/git/refs", input=post_parameters)
1475 return github.GitRef.GitRef(self._requester, headers, data, completed=True)
1476
1477 # TODO: v3: reorder arguments and add default value `NotSet` where `Opt[str]`
1478 def create_git_tag_and_release(

Callers 2

restore_branchMethod · 0.80
testCreateGitRefMethod · 0.80

Calls 1

requestJsonAndCheckMethod · 0.80

Tested by

no test coverage detected