diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-01-03 19:32:54 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-01-03 19:32:54 +0000 |
commit | 8fa58c719b42458603adb9397766d9dc570689fa (patch) | |
tree | ccf9579c3cac8d0c5e8b2922ff6fd3623c434f92 /app | |
parent | b23fd4e9ea79732f2639636c31525fa7756036ca (diff) | |
parent | 139ff5783b2eb2ff4b63a2f6c30695830a3984ff (diff) | |
download | gitlab-ce-8fa58c719b42458603adb9397766d9dc570689fa.tar.gz |
Merge branch '25836-changing-from-version-in-diff-comparison-does-not-preserve-to-version' into 'master'
Resolve changing "from" version in diff comparison does not preserve "to" version
Closes #25836
See merge request !8328
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 3 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show/_versions.html.haml | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index fc8a289d49d..6004e7d7115 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -98,7 +98,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController @start_version = @comparable_diffs.find { |diff| diff.head_commit_sha == @start_sha } unless @start_version - render_404 + @start_sha = @merge_request_diff.head_commit_sha + @start_version = @merge_request_diff end end diff --git a/app/views/projects/merge_requests/show/_versions.html.haml b/app/views/projects/merge_requests/show/_versions.html.haml index ac4a03220b9..b0f3c86fd21 100644 --- a/app/views/projects/merge_requests/show/_versions.html.haml +++ b/app/views/projects/merge_requests/show/_versions.html.haml @@ -19,7 +19,7 @@ %ul - @merge_request_diffs.each do |merge_request_diff| %li - = link_to merge_request_version_path(@project, @merge_request, merge_request_diff), class: ('is-active' if merge_request_diff == @merge_request_diff) do + = link_to merge_request_version_path(@project, @merge_request, merge_request_diff, @start_sha), class: ('is-active' if merge_request_diff == @merge_request_diff) do %strong - if merge_request_diff.latest? latest version |