diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index 2426a6b3c2..2702f6864f 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -996,7 +996,7 @@ func MergePullRequest(ctx *context.APIContext) { return } if strings.Contains(err.Error(), "Wrong commit ID") { - ctx.JSON(http.StatusConflict, err) + ctx.APIError(http.StatusConflict, err) return } ctx.APIErrorInternal(err)