api: support getting blob content (#7080)

Co-authored-by: Joe Chen <jc@unknwon.io>
This commit is contained in:
Yehonatan Ezron
2022-07-17 10:16:52 +03:00
committed by GitHub
parent ab7133b35a
commit a5d3e1900e
2 changed files with 56 additions and 2 deletions

View File

@@ -276,8 +276,13 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/*", repo.GetContents)
})
m.Get("/archive/*", repo.GetArchive)
m.Group("/git/trees", func() {
m.Get("/:sha", repo.GetRepoGitTree)
m.Group("/git", func() {
m.Group("/trees", func() {
m.Get("/:sha", repo.GetRepoGitTree)
})
m.Group("/blobs", func() {
m.Get("/:sha", repo.RepoGitBlob)
})
})
m.Get("/forks", repo.ListForks)
m.Get("/tags", repo.ListTags)