Add API to get commit diff/patch (#17095)

* Add API to get commit diff/patch
* Add Tests

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
qwerty287 2021-09-20 18:14:29 +02:00 committed by GitHub
parent d4bb8e0ae7
commit 5ac857f4d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 128 additions and 0 deletions

View file

@ -937,6 +937,7 @@ func Routes(sessioner func(http.Handler) http.Handler) *web.Route {
m.Group("/git", func() {
m.Group("/commits", func() {
m.Get("/{sha}", repo.GetSingleCommit)
m.Get("/{sha}.{diffType:diff|patch}", repo.DownloadCommitDiffOrPatch)
})
m.Get("/refs", repo.GetGitAllRefs)
m.Get("/refs/*", repo.GetGitRefs)