From 9385d346f1b9e6125efc8183749582c4ecce9bc1 Mon Sep 17 00:00:00 2001 From: yystopf Date: Mon, 29 Nov 2021 14:03:17 +0800 Subject: [PATCH] fix --- app/services/pull_requests/create_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/pull_requests/create_service.rb b/app/services/pull_requests/create_service.rb index 844df5cf5..3882df0f0 100644 --- a/app/services/pull_requests/create_service.rb +++ b/app/services/pull_requests/create_service.rb @@ -157,7 +157,8 @@ class PullRequests::CreateService < ApplicationService end def compare_head_base! - compare_result = Gitea::Repository::Commits::CompareService.call(@owner.login, @project.identifier, @params[:base], @params[:head], @current_user.gitea_token) + head = pull_request.is_original && @params[:merge_user_login] ? "#{@params[:merge_user_login]}/#{@project.identifier}:#{@params[:head]}" : @params[:head] + compare_result = Gitea::Repository::Commits::CompareService.call(@owner.login, @project.identifier, @params[:base], head, @current_user.gitea_token) raise '分支内容相同,无需创建合并请求' if compare_result["Commits"].blank? && compare_result["Diff"].blank? end