diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-05-29 00:09:28 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-05-29 00:09:28 -0400 |
commit | f46b3670680ba9d07a2745299764990c944c48a8 (patch) | |
tree | fa578307d3762eaac7d6177f2eb71c7d3b615ea0 /app/controllers/projects/merge_requests_controller.rb | |
parent | cef8ab460402b46002c0a25e90418f6920bb3c18 (diff) | |
download | gitlab-ce-f46b3670680ba9d07a2745299764990c944c48a8.tar.gz |
Add MergeRequests#commits action and route
/:namespace_id/:project_id/merge_requests/:id/commits(.:format)
Diffstat (limited to 'app/controllers/projects/merge_requests_controller.rb')
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index c7467e9b2f5..71d3051ab88 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -2,10 +2,13 @@ require 'gitlab/satellite/satellite' class Projects::MergeRequestsController < Projects::ApplicationController before_action :module_enabled - before_action :merge_request, only: [:edit, :update, :show, :diffs, :automerge, :automerge_check, :ci_status, :toggle_subscription] - before_action :closes_issues, only: [:edit, :update, :show, :diffs] - before_action :validates_merge_request, only: [:show, :diffs] - before_action :define_show_vars, only: [:show, :diffs] + before_action :merge_request, only: [ + :edit, :update, :show, :diffs, :commits, :automerge, :automerge_check, + :ci_status, :toggle_subscription + ] + before_action :closes_issues, only: [:edit, :update, :show, :diffs, :commits] + before_action :validates_merge_request, only: [:show, :diffs, :commits] + before_action :define_show_vars, only: [:show, :diffs, :commits] # Allow read any merge_request before_action :authorize_read_merge_request! @@ -27,7 +30,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController @merge_requests = @merge_requests.full_search(terms) end end - + @merge_requests = @merge_requests.page(params[:page]).per(PER_PAGE) respond_to do |format| @@ -67,6 +70,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController end end + def commits + render 'show' + end + def new params[:merge_request] ||= ActionController::Parameters.new(source_project: @project) @merge_request = MergeRequests::BuildService.new(project, current_user, merge_request_params).execute |