fix: create pr branch name escape

This commit is contained in:
yystopf 2021-12-28 18:37:44 +08:00
parent f3cf2c87c9
commit 8c99b754fb
1 changed files with 1 additions and 1 deletions

View File

@ -162,7 +162,7 @@ class PullRequests::CreateService < ApplicationService
def compare_head_base!
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)
compare_result = Gitea::Repository::Commits::CompareService.call(@owner.login, @project.identifier, CGI.escape(@params[:base]), CGI.escape(head), @current_user.gitea_token)
raise '分支内容相同,无需创建合并请求' if compare_result["Commits"].blank? && compare_result["Diff"].blank?
end