diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-08-10 22:55:32 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-08-10 22:55:32 +0300 |
commit | ad8390bc4e7fbe7974104e5c86cd0f6cf7fea112 (patch) | |
tree | fd41df30fa252ad85e794588ef900346edb0fbda /app | |
parent | b1aac0382c406b3856db90e15df8b2a9ea7ff6cd (diff) | |
parent | 5689e8a0827eb9f09b071bbd4dc74dc2cb0a3e7d (diff) |
Merge branch 'explicit-arguments-on-diff_file_html_data' into 'master'
Avoid commit lookup on diff_helper
See merge request !5756
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/diff_helper.rb | 5 | ||||
-rw-r--r-- | app/views/projects/diffs/_file.html.haml | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb index f3c9ea074b4..0725c3f4c56 100644 --- a/app/helpers/diff_helper.rb +++ b/app/helpers/diff_helper.rb @@ -109,11 +109,10 @@ module DiffHelper end end - def diff_file_html_data(project, diff_file) - commit = commit_for_diff(diff_file) + def diff_file_html_data(project, diff_file_path, diff_commit_id) { blob_diff_path: namespace_project_blob_diff_path(project.namespace, project, - tree_join(commit.id, diff_file.file_path)), + tree_join(diff_commit_id, diff_file_path)), view: diff_view } end diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml index f0a86fd6d40..8fbd89100ca 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-#{index}", data: diff_file_html_data(project, diff_file)} +.diff-file.file-holder{id: "diff-#{index}", data: diff_file_html_data(project, diff_file.file_path, diff_commit.id)} .file-title{id: "file-path-#{hexdigest(diff_file.file_path)}"} = render "projects/diffs/file_header", diff_file: diff_file, blob: blob, diff_commit: diff_commit, project: project, url: "#diff-#{index}" |