This commit is contained in:
yystopf 2021-11-29 14:03:17 +08:00
parent 22f3371090
commit 9385d346f1
1 changed files with 2 additions and 1 deletions

View File

@ -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