diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index 2d77c21d4..c563100ea 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -46,7 +46,7 @@ class PullRequestsController < ApplicationController source_branch = params[:source_branch] target_branch = params[:target_branch] begin - request = @g.create_merge_request(@project.gpid, title, :description => description, :source_branch => source_branch, :target_branch => target_branch) + request = @g.create_merge_request(@project.gpid, title, User.current.gid, :description => description, :source_branch => source_branch, :target_branch => target_branch) respond_to do |format| format.js{redirect_to project_pull_request_path(request.id, :project_id => @project.id)} end diff --git a/app/views/pull_requests/_pull_requests_list.html.erb b/app/views/pull_requests/_pull_requests_list.html.erb index 0e9e0c918..db9059710 100644 --- a/app/views/pull_requests/_pull_requests_list.html.erb +++ b/app/views/pull_requests/_pull_requests_list.html.erb @@ -1,4 +1,4 @@ -<% if @requests.nil? %> +<% if @requests.blank? %>
没有可显示的请求
<% else %> <% @requests.each do |request| %> diff --git a/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb b/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb index b0f9dbcb7..17b12cdaa 100644 --- a/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb +++ b/lib/gitlab-cli/lib/gitlab/client/merge_requests.rb @@ -43,11 +43,11 @@ class Gitlab::Client # @option options [String] :target_branch (required) The target branch name. # @option options [Integer] :assignee_id (optional) The ID of a user to assign merge request. # @return [Gitlab::ObjectifiedHash] Information about created merge request. - def create_merge_request(project, title, options={}) + def create_merge_request(project, title, gid, options={}) check_attributes!(options, [:source_branch, :target_branch]) body = {:title => title}.merge(options) - post("/projects/#{project}/merge_requests", :body => body) + post("/projects/#{project}/merge_requests?user_id=#{gid}", :body => body) end # Updates a merge request.