Browse Source

fixed 分支删除时有开启的pr需要一同关闭,整理fix

pull/338/head
xxq250 2 years ago
parent
commit
6248040f8c
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/controllers/api/v1/projects/branches_controller.rb

+ 1
- 1
app/controllers/api/v1/projects/branches_controller.rb View File

@@ -50,7 +50,7 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
end

def close_pull_requests_by(project, branch_name)
open_pull_requests = project.pull_requests.opening.where(head: branch_name).or(a.pull_requests.opening.where(base: branch_name))
open_pull_requests = project.pull_requests.opening.where(head: branch_name).or(project.pull_requests.opening.where(base: branch_name))
if open_pull_requests.present?
open_pull_requests.each do |pull_request|
closed = PullRequests::CloseService.call(project.owner, project.repository, pull_request, current_user)


Loading…
Cancel
Save