enhance(api): add GitHub-compatible /repos/{owner}/{repo}/commits/{ref} endpoint (#38770)

Gitea currently exposes the endpoint:
 
`GET /repos/{owner}/{repo}/git/commits/{sha}`
 
to retrieve a single commit. However, GitHub provides the equivalent
endpoint as:
 
`GET /repos/{owner}/{repo}/commits/{ref}`
 
Applications integrating with both GitHub and Gitea must implement
platform-specific logic to use different endpoints, reducing API
compatibility.
 
Fixes #38225

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
Mitrahsoft
2026-08-05 22:49:31 +05:30
committed by GitHub
parent c98a1597c9
commit c46f0d545e
5 changed files with 16 additions and 17 deletions
+1 -1
View File
@@ -20470,7 +20470,7 @@
"$ref": "#/components/responses/validationError"
}
},
"summary": "Get a single commit from a repository",
"summary": "Get a single commit from a repository, it has a GitHub-compatible alias \"/repos/{owner}/{repo}/commits/{ref}\"",
"tags": [
"repository"
]