Code of Conduct
What article on docs.github.com is affected?
The docs for this endpoint say /repos/{owner}/{repo}/git/ref/{ref}:
ref string Required
The commit reference. Can be a commit SHA, branch name (heads/BRANCH_NAME), or tag name (tags/TAG_NAME). For more information, see "Git References" in the Git documentation.
(emphasis mine)
Yet the ref API responds with 404 when used with a (valid) commit SHA:
$ gh api repos/scverse/anndata/git/ref/a4786471ee4d4e894fec150e426c3551db0f31e0
gh: Not Found (HTTP 404)
{
"message": "Not Found",
"documentation_url": "https://docs.github.com/rest/git/refs#get-a-reference"
}
whereas the commits API works:
$ gh api repos/scverse/anndata/commits/a4786471ee4d4e894fec150e426c3551db0f31e0
{
"sha": "a4786471ee4d4e894fec150e426c3551db0f31e0",
"node_id": "C_kwDOBfZ26doAKGE0Nzg2NDcxZWU0ZDRlODk0ZmVjMTUwZTQyNmMzNTUxZGIwZjMxZTA",
"commit": {...},
...
}
using the ref API with e.g. branch also works as documented:
$ gh api repos/scverse/anndata/git/ref/heads/main
{
"ref": "refs/heads/main",
"node_id": "MDM6UmVmMTAwMDM4Mzc3OnJlZnMvaGVhZHMvbWFpbg==",
"url": "https://api.github.com/repos/scverse/anndata/git/refs/heads/main",
"object": {
"sha": "a4786471ee4d4e894fec150e426c3551db0f31e0",
"type": "commit",
"url": "https://api.github.com/repos/scverse/anndata/git/commits/a4786471ee4d4e894fec150e426c3551db0f31e0"
}
}
What part(s) of the article would you like to see updated?
Either the documentation for the ref path parameter needs to be updated or the ref API needs to start working with commits as documented.
Additional information
No response
Code of Conduct
What article on docs.github.com is affected?
The docs for this endpoint say
/repos/{owner}/{repo}/git/ref/{ref}:(emphasis mine)
Yet the
refAPI responds with 404 when used with a (valid) commit SHA:whereas the
commitsAPI works:using the
refAPI with e.g. branch also works as documented:What part(s) of the article would you like to see updated?
Either the documentation for the
refpath parameter needs to be updated or therefAPI needs to start working with commits as documented.Additional information
No response