From 3e633ea6cc430e183722e1aa16548bd2c478951a Mon Sep 17 00:00:00 2001 From: jasder Date: Wed, 10 Nov 2021 11:16:17 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20=E5=8F=91=E9=80=81pr=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=88=86=E6=94=AF=E5=AF=B9=E6=AF=94=E5=8A=9F=E8=83=BD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0gitea=20=E6=8E=A5=E5=8F=A3=E6=94=AF=E6=8C=81(pr=5Fmerg?= =?UTF-8?q?e=20api)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/pull_requests_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index b4003455..69d9e60b 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -182,7 +182,12 @@ class PullRequestsController < ApplicationController message: "在这些分支之间的合并请求已存在:#{can_merge.first.try(:title)}", } else - normal_status(0, "可以合并") + compare_result = Repositories::CompareService.call(@owner, @project, params) + if compare_result['Diff'].blank? + normal_status(0, "可以合并") + else + normal_status(-2, "分支内容相同,无需创建合并请求") + end end end end