summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/api.go
diff options
context:
space:
mode:
authorqwerty287 <80460567+qwerty287@users.noreply.github.com>2021-09-20 18:14:29 +0200
committerGitHub <noreply@github.com>2021-09-20 18:14:29 +0200
commit5ac857f4d43a8452089e22c820bd1f0ddb001b7a (patch)
tree83fdf358fd8faea906fe08bc18486dfa5c12973d /routers/api/v1/api.go
parentd4bb8e0ae7aa9bdd769a935770dfe7046d519313 (diff)
downloadgitea-5ac857f4d43a8452089e22c820bd1f0ddb001b7a.tar.gz
gitea-5ac857f4d43a8452089e22c820bd1f0ddb001b7a.zip
Add API to get commit diff/patch (#17095)
* Add API to get commit diff/patch * Add Tests Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r--routers/api/v1/api.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index d859642c42..90189701c0 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -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)