diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-26 09:21:42 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-08-03 07:00:20 +0200 |
commit | 8f359ea9170b984ad43d126e17628c31ac3a1f14 (patch) | |
tree | ee47d5172537ddedabc2cc38ef3cb5bf966c89ee /app/controllers/projects/commit_controller.rb | |
parent | cd7c2cb6ddd4d9c9f9bdae00c887c0022c121c17 (diff) | |
download | gitlab-ce-8f359ea9170b984ad43d126e17628c31ac3a1f14.tar.gz |
Move to Gitlab::Diff::FileCollection
Instead calling diff_collection.count use diff_collection.size which is cache on the diff_collection
Diffstat (limited to 'app/controllers/projects/commit_controller.rb')
-rw-r--r-- | app/controllers/projects/commit_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 6060b6e55bc..771a86530cd 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -28,7 +28,7 @@ class Projects::CommitController < Projects::ApplicationController end def diff_for_path - render_diff_for_path(SafeDiffs::Commit.new(@commit, diff_options: diff_options)) + render_diff_for_path(@commit.diff_file_collection(diff_options)) end def builds @@ -110,7 +110,7 @@ class Projects::CommitController < Projects::ApplicationController opts = diff_options opts[:ignore_whitespace_change] = true if params[:format] == 'diff' - @diffs = SafeDiffs::Commit.new(commit, diff_options: opts) + @diffs = commit.diff_file_collection(opts) @notes_count = commit.notes.count end |