From 999f47e9e6da399de9dc1de404f073f7dd30af0d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 12 Aug 2020 12:10:25 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/controllers/projects/commit_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/controllers/projects/commit_controller.rb') diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 3f2dc9b09fa..b0c6f3cc6a1 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -15,8 +15,8 @@ class Projects::CommitController < Projects::ApplicationController before_action :authorize_download_code! before_action :authorize_read_pipeline!, only: [:pipelines] before_action :commit - before_action :define_commit_vars, only: [:show, :diff_for_path, :pipelines, :merge_requests] - before_action :define_note_vars, only: [:show, :diff_for_path] + before_action :define_commit_vars, only: [:show, :diff_for_path, :diff_files, :pipelines, :merge_requests] + before_action :define_note_vars, only: [:show, :diff_for_path, :diff_files] before_action :authorize_edit_tree!, only: [:revert, :cherry_pick] BRANCH_SEARCH_LIMIT = 1000 @@ -41,6 +41,10 @@ class Projects::CommitController < Projects::ApplicationController render_diff_for_path(@commit.diffs(diff_options)) end + def diff_files + render json: { html: view_to_html_string('projects/commit/diff_files', diffs: @diffs, environment: @environment) } + end + # rubocop: disable CodeReuse/ActiveRecord def pipelines @pipelines = @commit.pipelines.order(id: :desc) -- cgit v1.2.3