From ba79b8f4e6af5f00644ec7a05691fe9d5fec3bc0 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Tue, 30 Jun 2020 15:53:01 +0800 Subject: [PATCH] FIX create local pull request's bug --- app/controllers/pull_requests_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index 41a56d146..7e29c126d 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -68,7 +68,8 @@ class PullRequestsController < ApplicationController } local_requests = PullRequest.new(@local_params.merge(pr_params)) if local_requests.save - remote_pr_params = @local_params.merge(head: "#{params[:merge_user_login]}:#{params[:head]}").compact if local_requests.is_original && params[:merge_user_login] + remote_pr_params = @local_params + remote_pr_params = remote_pr_params.merge(head: "#{params[:merge_user_login]}:#{params[:head]}").compact if local_requests.is_original && params[:merge_user_login] gitea_request = Gitea::PullRequest::CreateService.call(current_user.try(:gitea_token), @project.owner, @repository.try(:identifier), remote_pr_params.except(:milestone)) if gitea_request && local_requests.update_attributes(gpid: gitea_request["number"]) if params[:issue_tag_ids].present?