summaryrefslogtreecommitdiff
path: root/app/helpers/diff_helper.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-07-06 19:29:41 -0400
committerDouwe Maan <douwe@selenight.nl>2016-07-06 19:29:41 -0400
commitac26b23712963b0471db9742fc340ea4fb8935a9 (patch)
tree3eb3eea43ed5ffe83b453807ceef00488a0fe2e5 /app/helpers/diff_helper.rb
parent2db75f8debd96c48c6cb8548824dd72bd71fb176 (diff)
downloadgitlab-ce-ac26b23712963b0471db9742fc340ea4fb8935a9.tar.gz
Remove duplication, unused methods, and some other style things
Diffstat (limited to 'app/helpers/diff_helper.rb')
-rw-r--r--app/helpers/diff_helper.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb
index c7c291516fc..eb57516247d 100644
--- a/app/helpers/diff_helper.rb
+++ b/app/helpers/diff_helper.rb
@@ -89,6 +89,8 @@ module DiffHelper
end
def commit_for_diff(diff_file)
+ return diff_file.content_commit if diff_file.content_commit
+
if diff_file.deleted_file
@base_commit || @commit.parent || @commit
else
@@ -97,7 +99,7 @@ module DiffHelper
end
def diff_file_html_data(project, diff_file)
- commit = diff_file.content_commit || commit_for_diff(diff_file)
+ commit = commit_for_diff(diff_file)
{
blob_diff_path: namespace_project_blob_diff_path(project.namespace, project,
tree_join(commit.id, diff_file.file_path))