Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-05-15 21:19:49 +0300
committerDouwe Maan <douwe@selenight.nl>2017-05-23 23:37:05 +0300
commit7c479d88a92233790bc0fb63146fe004f8b9b5d7 (patch)
tree3691c9e55229b145ea631bca724ba4da8c467d70 /app/helpers/diff_helper.rb
parent7e09a9b7dcef125af2e775869754a3327935b12d (diff)
Pass fallback_diff_refs to Diff::File instead of using view helpers
Diffstat (limited to 'app/helpers/diff_helper.rb')
-rw-r--r--app/helpers/diff_helper.rb24
1 files changed, 4 insertions, 20 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb
index 4cfaa103741..4c4fbdd4d39 100644
--- a/app/helpers/diff_helper.rb
+++ b/app/helpers/diff_helper.rb
@@ -102,30 +102,14 @@ module DiffHelper
].join(' ').html_safe
end
- def diff_content_commit(diff_file)
- content_commit = diff_file.content_commit
- return content_commit if content_commit
-
- if diff_file.deleted_file?
- diff_old_content_commit(diff_file)
- else
- @commit
- end
- end
-
- def diff_old_content_commit(diff_file)
- return if diff_file.new_file?
-
- diff_file.old_content_commit || @base_commit || @commit.parent || @commit
- end
-
def diff_file_blob_raw_path(diff_file)
- namespace_project_raw_path(@project.namespace, @project, tree_join(diff_content_commit(diff_file).sha, diff_file.file_path))
+ namespace_project_raw_path(@project.namespace, @project, tree_join(diff_file.content_sha, diff_file.file_path))
end
def diff_file_old_blob_raw_path(diff_file)
- return if diff_file.new_file?
- namespace_project_raw_path(@project.namespace, @project, tree_join(diff_old_content_commit(diff_file).sha, diff_file.old_path))
+ sha = diff_file.old_content_sha
+ return unless sha
+ namespace_project_raw_path(@project.namespace, @project, tree_join(diff_file.old_content_sha, diff_file.old_path))
end
def diff_file_html_data(project, diff_file_path, diff_commit_id)