aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1')
-rw-r--r--routers/api/v1/repo/pull.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go
index 1c28363e8a..3974069ab4 100644
--- a/routers/api/v1/repo/pull.go
+++ b/routers/api/v1/repo/pull.go
@@ -204,6 +204,10 @@ func DownloadPullDiffOrPatch(ctx *context.APIContext) {
// type: string
// enum: [diff, patch]
// required: true
+ // - name: binary
+ // in: query
+ // description: whether to include binary file changes. if true, the diff is applicable with `git apply`
+ // type: boolean
// responses:
// "200":
// "$ref": "#/responses/string"
@@ -225,7 +229,9 @@ func DownloadPullDiffOrPatch(ctx *context.APIContext) {
patch = true
}
- if err := pull_service.DownloadDiffOrPatch(pr, ctx, patch); err != nil {
+ binary := ctx.FormBool("binary")
+
+ if err := pull_service.DownloadDiffOrPatch(pr, ctx, patch, binary); err != nil {
ctx.InternalServerError(err)
return
}