summaryrefslogtreecommitdiff
path: root/app/views/projects/diffs
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-06-20 18:54:53 +0200
committerDouwe Maan <douwe@selenight.nl>2016-07-06 18:50:58 -0400
commit9fc0e11e0dbd541c8c0bca60878178ca94ad34e1 (patch)
tree4ecdb99f6c0247ec8d51eaa1d85aba470a3c890b /app/views/projects/diffs
parent17ab745e40bf89776ab16de9ba00ebb44d1c85ca (diff)
downloadgitlab-ce-9fc0e11e0dbd541c8c0bca60878178ca94ad34e1.tar.gz
Add DiffFile#blob and #old_blob
Diffstat (limited to 'app/views/projects/diffs')
-rw-r--r--app/views/projects/diffs/_diffs.html.haml4
-rw-r--r--app/views/projects/diffs/_file.html.haml6
2 files changed, 5 insertions, 5 deletions
diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml
index 151780addc5..8f252282692 100644
--- a/app/views/projects/diffs/_diffs.html.haml
+++ b/app/views/projects/diffs/_diffs.html.haml
@@ -23,8 +23,8 @@
.files
- diff_files.each_with_index do |diff_file, index|
- - diff_commit = commit_for_diff(diff_file)
- - blob = project.repository.blob_for_diff(diff_commit, diff_file)
+ - diff_commit = diff_file.content_commit || commit_for_diff(diff_file)
+ - blob = diff_file.blob(diff_commit)
- next unless blob
- blob.load_all_data!(project.repository) unless blob.only_display_raw?
diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml
index 2395ea3c275..8fc5237e935 100644
--- a/app/views/projects/diffs/_file.html.haml
+++ b/app/views/projects/diffs/_file.html.haml
@@ -1,4 +1,4 @@
-.diff-file.file-holder{id: "diff-#{i}", data: diff_file_html_data(project, diff_commit, diff_file)}
+.diff-file.file-holder{id: "diff-#{i}", data: diff_file_html_data(project, diff_file)}
.file-title{id: "file-path-#{hexdigest(diff_file.file_path)}"}
- if diff_file.diff.submodule?
%span
@@ -52,7 +52,7 @@
- elsif blob.only_display_raw?
.nothing-here-block This file is too large to display.
- elsif blob.image?
- - old_file = project.repository.prev_blob_for_diff(diff_commit, diff_file)
- = render "projects/diffs/image", diff_file: diff_file, old_file: old_file, file: blob, index: i, diff_refs: diff_refs
+ - old_blob = diff_file.old_blob(diff_commit)
+ = render "projects/diffs/image", diff_file: diff_file, old_file: old_blob, file: blob, index: i
- else
.nothing-here-block No preview for this file type