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 /templates | |
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 'templates')
-rw-r--r-- | templates/swagger/v1_json.tmpl | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 69081777dc..77c89aea3a 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -3581,6 +3581,60 @@ } } }, + "/repos/{owner}/{repo}/git/commits/{sha}.{diffType}": { + "get": { + "produces": [ + "text/plain" + ], + "tags": [ + "repository" + ], + "summary": "Get a commit's diff or patch", + "operationId": "repoDownloadCommitDiffOrPatch", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "SHA of the commit to get", + "name": "sha", + "in": "path", + "required": true + }, + { + "enum": [ + "diff", + "patch" + ], + "type": "string", + "description": "whether the output is diff or patch", + "name": "diffType", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "$ref": "#/responses/string" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/repos/{owner}/{repo}/git/notes/{sha}": { "get": { "produces": [ |