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:
parent
59b9b77a0d
commit
32b8172e56
4 changed files with 15 additions and 119 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue