summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/pull.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/pull.go')
-rw-r--r--routers/api/v1/repo/pull.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go
index 6d86105a15..6af1ba1b04 100644
--- a/routers/api/v1/repo/pull.go
+++ b/routers/api/v1/repo/pull.go
@@ -626,6 +626,18 @@ func MergePullRequest(ctx *context.APIContext, form auth.MergePullRequestForm) {
if models.IsErrInvalidMergeStyle(err) {
ctx.Status(405)
return
+ } else if models.IsErrMergeConflicts(err) {
+ conflictError := err.(models.ErrMergeConflicts)
+ ctx.JSON(http.StatusConflict, conflictError)
+ } else if models.IsErrRebaseConflicts(err) {
+ conflictError := err.(models.ErrRebaseConflicts)
+ ctx.JSON(http.StatusConflict, conflictError)
+ } else if models.IsErrMergeUnrelatedHistories(err) {
+ conflictError := err.(models.ErrMergeUnrelatedHistories)
+ ctx.JSON(http.StatusConflict, conflictError)
+ } else if models.IsErrMergePushOutOfDate(err) {
+ ctx.Status(http.StatusConflict)
+ return
}
ctx.Error(500, "Merge", err)
return