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:
Diffstat (limited to 'app/views/projects/commits/_diff_file.html.haml')
-rw-r--r--app/views/projects/commits/_diff_file.html.haml5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/views/projects/commits/_diff_file.html.haml b/app/views/projects/commits/_diff_file.html.haml
index 45d1cd9c9a0..9cbcb84aead 100644
--- a/app/views/projects/commits/_diff_file.html.haml
+++ b/app/views/projects/commits/_diff_file.html.haml
@@ -1,5 +1,4 @@
-- file = project.repository.blob_at(@commit.id, diff.new_path)
-- file = project.repository.blob_at(@commit.parent_id, diff.old_path) unless file
+- file = project.repository.blob_for_diff(@commit, diff)
- return unless file
.diff-file{id: "diff-#{i}"}
.diff-header{id: "file-path-#{hexdigest(diff.new_path || diff.old_path)}"}
@@ -41,7 +40,7 @@
- else
= render "projects/commits/text_file", diff: diff, index: i
- elsif file.image?
- - old_file = project.repository.blob_at(@commit.parent_id, diff.old_path) if @commit.parent_id
+ - old_file = project.repository.prev_blob_for_diff(@commit, diff)
= render "projects/commits/image", diff: diff, old_file: old_file, file: file, index: i
- else
.nothing-here-block No preview for this file type