diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-04-11 10:51:48 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-04-11 10:51:48 -0500 |
commit | 543dcdacc2d4536ddeb1d88a7fa85e5fefed3f80 (patch) | |
tree | c87545103d4c5363e1284c640d0729357db9a7f3 | |
parent | 4f8c36c03c0f0aebc3956fa530f1b78ae3c76fc0 (diff) | |
download | gitlab-ce-543dcdacc2d4536ddeb1d88a7fa85e5fefed3f80.tar.gz |
Statisfy Robertcop and Seancopdm-outdated-diff-link
-rw-r--r-- | app/models/merge_request_diff.rb | 12 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show/_versions.html.haml | 2 |
2 files changed, 4 insertions, 10 deletions
diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb index 08066db4767..6604af2b47e 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -135,15 +135,9 @@ class MergeRequestDiff < ActiveRecord::Base end def diff_refs=(new_diff_refs) - if new_diff_refs - self.base_commit_sha = new_diff_refs.base_sha - self.start_commit_sha = new_diff_refs.start_sha - self.head_commit_sha = new_diff_refs.head_sha - else - self.base_commit_sha = nil - self.start_commit_sha = nil - self.head_commit_sha = nil - end + self.base_commit_sha = new_diff_refs&.base_sha + self.start_commit_sha = new_diff_refs&.start_sha + self.head_commit_sha = new_diff_refs&.head_sha end def diff_refs diff --git a/app/views/projects/merge_requests/show/_versions.html.haml b/app/views/projects/merge_requests/show/_versions.html.haml index 434d9b5837f..547be78992e 100644 --- a/app/views/projects/merge_requests/show/_versions.html.haml +++ b/app/views/projects/merge_requests/show/_versions.html.haml @@ -81,7 +81,7 @@ - if @start_sha Comments are disabled because you're comparing two versions of this merge request. - else - Discussions on this old version of the merge request are displayed but comment creation is disabled. + Discussions on this version of the merge request are displayed but comment creation is disabled. .pull-right = link_to 'Show latest version', diffs_namespace_project_merge_request_path(@project.namespace, @project, @merge_request), class: 'btn btn-sm' |