diff options
author | micael.bergeron <micaelbergeron@gmail.com> | 2017-11-22 17:48:09 +0300 |
---|---|---|
committer | micael.bergeron <micaelbergeron@gmail.com> | 2017-12-07 17:01:37 +0300 |
commit | cb6f51ec9b2006f1040cca94119135c92e9a4cd1 (patch) | |
tree | 6331c54f8eab568e134c51ec85a0232372471a16 /app/controllers/projects/merge_requests | |
parent | 716f9cbb415cd425644b1aeae19844b26cc7d6b7 (diff) |
add support for the commit reference filter
Diffstat (limited to 'app/controllers/projects/merge_requests')
-rw-r--r-- | app/controllers/projects/merge_requests/diffs_controller.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/projects/merge_requests/diffs_controller.rb b/app/controllers/projects/merge_requests/diffs_controller.rb index 07bf9db5a34..fe8525a488c 100644 --- a/app/controllers/projects/merge_requests/diffs_controller.rb +++ b/app/controllers/projects/merge_requests/diffs_controller.rb @@ -21,8 +21,7 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic private def define_diff_vars - @merge_request_diffs = @merge_request.merge_request_diffs.viewable.select_without_diff.order_id_desc - + @merge_request_diffs = @merge_request.merge_request_diffs.viewable.order_id_desc @compare = commit || find_merge_request_diff_compare return render_404 unless @compare @@ -31,7 +30,7 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic def commit return nil unless commit_id = params[:commit_id].presence - return nil unless @merge_request.all_commit_shas.include?(commit_id) + return nil unless @merge_request.all_commits.exists?(sha: commit_id) @commit ||= @project.commit(commit_id) end |