diff options
author | qwerty287 <80460567+qwerty287@users.noreply.github.com> | 2021-09-20 18:14:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-20 18:14:29 +0200 |
commit | 5ac857f4d43a8452089e22c820bd1f0ddb001b7a (patch) | |
tree | 83fdf358fd8faea906fe08bc18486dfa5c12973d /routers/api/v1/api.go | |
parent | d4bb8e0ae7aa9bdd769a935770dfe7046d519313 (diff) | |
download | gitea-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.go | 1 |
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) |