Commit 685681e28af2cae7c5ba208130ad5b6b4e5c4ed9
1 parent
2a6b4f96
Exists in
master
and in
4 other branches
remove Tree/Commit decorator usage from controllers
Showing
4 changed files
with
0 additions
and
10 deletions
Show diff stats
app/controllers/commits_controller.rb
| @@ -13,8 +13,6 @@ class CommitsController < ProjectResourceController | @@ -13,8 +13,6 @@ class CommitsController < ProjectResourceController | ||
| 13 | @limit, @offset = (params[:limit] || 40), (params[:offset] || 0) | 13 | @limit, @offset = (params[:limit] || 40), (params[:offset] || 0) |
| 14 | 14 | ||
| 15 | @commits = @repo.commits(@ref, @path, @limit, @offset) | 15 | @commits = @repo.commits(@ref, @path, @limit, @offset) |
| 16 | - @commits = Commit.decorate(@commits) | ||
| 17 | - @commits = CommitDecorator.decorate_collection(@commits) | ||
| 18 | 16 | ||
| 19 | respond_to do |format| | 17 | respond_to do |format| |
| 20 | format.html # index.html.erb | 18 | format.html # index.html.erb |
app/controllers/compare_controller.rb
| @@ -15,8 +15,6 @@ class CompareController < ProjectResourceController | @@ -15,8 +15,6 @@ class CompareController < ProjectResourceController | ||
| 15 | @diffs = result[:diffs] | 15 | @diffs = result[:diffs] |
| 16 | @refs_are_same = result[:same] | 16 | @refs_are_same = result[:same] |
| 17 | @line_notes = [] | 17 | @line_notes = [] |
| 18 | - | ||
| 19 | - @commits = CommitDecorator.decorate_collection(@commits) | ||
| 20 | end | 18 | end |
| 21 | 19 | ||
| 22 | def create | 20 | def create |
app/controllers/merge_requests_controller.rb
| @@ -94,12 +94,10 @@ class MergeRequestsController < ProjectResourceController | @@ -94,12 +94,10 @@ class MergeRequestsController < ProjectResourceController | ||
| 94 | 94 | ||
| 95 | def branch_from | 95 | def branch_from |
| 96 | @commit = @repository.commit(params[:ref]) | 96 | @commit = @repository.commit(params[:ref]) |
| 97 | - @commit = CommitDecorator.decorate(@commit) | ||
| 98 | end | 97 | end |
| 99 | 98 | ||
| 100 | def branch_to | 99 | def branch_to |
| 101 | @commit = @repository.commit(params[:ref]) | 100 | @commit = @repository.commit(params[:ref]) |
| 102 | - @commit = CommitDecorator.decorate(@commit) | ||
| 103 | end | 101 | end |
| 104 | 102 | ||
| 105 | def ci_status | 103 | def ci_status |
| @@ -143,7 +141,6 @@ class MergeRequestsController < ProjectResourceController | @@ -143,7 +141,6 @@ class MergeRequestsController < ProjectResourceController | ||
| 143 | # Get commits from repository | 141 | # Get commits from repository |
| 144 | # or from cache if already merged | 142 | # or from cache if already merged |
| 145 | @commits = @merge_request.commits | 143 | @commits = @merge_request.commits |
| 146 | - @commits = CommitDecorator.decorate_collection(@commits) | ||
| 147 | 144 | ||
| 148 | @allowed_to_merge = allowed_to_merge? | 145 | @allowed_to_merge = allowed_to_merge? |
| 149 | @show_merge_controls = @merge_request.opened? && @commits.any? && @allowed_to_merge | 146 | @show_merge_controls = @merge_request.opened? && @commits.any? && @allowed_to_merge |
app/controllers/refs_controller.rb
| @@ -34,7 +34,6 @@ class RefsController < ProjectResourceController | @@ -34,7 +34,6 @@ class RefsController < ProjectResourceController | ||
| 34 | @logs = contents.map do |content| | 34 | @logs = contents.map do |content| |
| 35 | file = params[:path] ? File.join(params[:path], content.name) : content.name | 35 | file = params[:path] ? File.join(params[:path], content.name) : content.name |
| 36 | last_commit = @repo.commits(@commit.id, file, 1).last | 36 | last_commit = @repo.commits(@commit.id, file, 1).last |
| 37 | - last_commit = CommitDecorator.decorate(last_commit) | ||
| 38 | { | 37 | { |
| 39 | file_name: content.name, | 38 | file_name: content.name, |
| 40 | commit: last_commit | 39 | commit: last_commit |
| @@ -49,9 +48,7 @@ class RefsController < ProjectResourceController | @@ -49,9 +48,7 @@ class RefsController < ProjectResourceController | ||
| 49 | 48 | ||
| 50 | @repo = project.repository | 49 | @repo = project.repository |
| 51 | @commit = @repo.commit(@ref) | 50 | @commit = @repo.commit(@ref) |
| 52 | - @commit = CommitDecorator.decorate(@commit) | ||
| 53 | @tree = Tree.new(@commit.tree, @ref, params[:path]) | 51 | @tree = Tree.new(@commit.tree, @ref, params[:path]) |
| 54 | - @tree = TreeDecorator.new(@tree) | ||
| 55 | @hex_path = Digest::SHA1.hexdigest(params[:path] || "") | 52 | @hex_path = Digest::SHA1.hexdigest(params[:path] || "") |
| 56 | 53 | ||
| 57 | if params[:path] | 54 | if params[:path] |