summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-07-11 18:17:00 +0100
committerSean McGivern <sean@gitlab.com>2016-07-11 18:17:00 +0100
commit8ee3c28bcde45e0719e0ef76731b9c92edfcddd9 (patch)
tree243253a2c31776cae90abc3791b3eabc77edf57e /app/controllers
parent93ab68607922e0bd0e22c40528a9d58fc50f50cd (diff)
downloadgitlab-ce-8ee3c28bcde45e0719e0ef76731b9c92edfcddd9.tar.gz
Handle more than two paths in MergeRequest#diffs
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/concerns/diff_for_path.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/concerns/diff_for_path.rb b/app/controllers/concerns/diff_for_path.rb
index 5ca8d3af0c9..e09b8789eb2 100644
--- a/app/controllers/concerns/diff_for_path.rb
+++ b/app/controllers/concerns/diff_for_path.rb
@@ -2,7 +2,9 @@ module DiffForPath
extend ActiveSupport::Concern
def render_diff_for_path(diffs, diff_refs, project)
- diff_file = safe_diff_files(diffs, diff_refs: diff_refs, repository: project.repository).first
+ diff_file = safe_diff_files(diffs, diff_refs: diff_refs, repository: project.repository).find do |diff|
+ diff.old_path == params[:old_path] && diff.new_path == params[:new_path]
+ end
return render_404 unless diff_file