1
0
Fork 0
forked from forgejo/forgejo

Consolidate API for getting single commit (#11368)

* Allow Git ref for /repos/{owner}/{repo}/git/commits/{sha}

* Consolidate API for getting single commit

* Fix tests and do it differently

Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
Cirno the Strongest 2020-05-11 11:44:36 +02:00 committed by GitHub
parent 59b9b77a0d
commit 32b8172e56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 119 deletions

View file

@ -817,14 +817,13 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Group("/commits", func() {
m.Get("", repo.GetAllCommits)
m.Group("/:ref", func() {
m.Get("", repo.GetSingleCommitByRef)
m.Get("/status", repo.GetCombinedCommitStatusByRef)
m.Get("/statuses", repo.GetCommitStatusesByRef)
})
}, reqRepoReader(models.UnitTypeCode))
m.Group("/git", func() {
m.Group("/commits", func() {
m.Get("/:sha", repo.GetSingleCommitBySHA)
m.Get("/:sha", repo.GetSingleCommit)
})
m.Get("/refs", repo.GetGitAllRefs)
m.Get("/refs/*", repo.GetGitRefs)