summaryrefslogtreecommitdiff
path: root/app/views/projects/diffs/_content.html.haml
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-05-15 13:19:49 -0500
committerDouwe Maan <douwe@selenight.nl>2017-05-23 15:37:05 -0500
commit7c479d88a92233790bc0fb63146fe004f8b9b5d7 (patch)
tree3691c9e55229b145ea631bca724ba4da8c467d70 /app/views/projects/diffs/_content.html.haml
parent7e09a9b7dcef125af2e775869754a3327935b12d (diff)
downloadgitlab-ce-7c479d88a92233790bc0fb63146fe004f8b9b5d7.tar.gz
Pass fallback_diff_refs to Diff::File instead of using view helpers
Diffstat (limited to 'app/views/projects/diffs/_content.html.haml')
-rw-r--r--app/views/projects/diffs/_content.html.haml9
1 files changed, 3 insertions, 6 deletions
diff --git a/app/views/projects/diffs/_content.html.haml b/app/views/projects/diffs/_content.html.haml
index b361619fc79..c7e22a0b4ec 100644
--- a/app/views/projects/diffs/_content.html.haml
+++ b/app/views/projects/diffs/_content.html.haml
@@ -1,7 +1,4 @@
-- diff_commit = local_assigns.fetch(:diff_commit) { diff_content_commit(diff_file) }
-- diff_old_commit = local_assigns.fetch(:diff_old_commit) { diff_old_content_commit(diff_file) }
-- blob = local_assigns.fetch(:blob) { diff_file.blob(diff_commit) }
-- old_blob = local_assigns.fetch(:old_blob) { diff_file.old_blob(diff_old_commit) }
+- blob = diff_file.blob
.diff-content
- if diff_file.too_large?
@@ -18,13 +15,13 @@
%a.click-to-expand
Click to expand it.
- elsif diff_file.diff_lines.length > 0
- = render "projects/diffs/viewers/text", diff_file: diff_file, blob: blob
+ = render "projects/diffs/viewers/text", diff_file: diff_file
- else
- if diff_file.mode_changed?
.nothing-here-block File mode changed
- elsif diff_file.renamed_file?
.nothing-here-block File moved
- elsif blob.image?
- = render "projects/diffs/viewers/image", diff_file: diff_file, blob: blob, old_blob: old_blob
+ = render "projects/diffs/viewers/image", diff_file: diff_file
- else
.nothing-here-block No preview for this file type